How to use the webiny-api/graphql.schema.getType function in webiny-api

To help you get started, we’ve selected a few webiny-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webiny / webiny-js / packages / demo-api / src / myApp.js View on Github external
init({ api }, next) {
            schema.addQueryField({
                name: "site",
                type: createResponseType(GraphQLDateTime),
                args: {
                  date: { type: GraphQLDateTime }
                },
                resolve: responseResolver((obj, args) => {
                    throw Error("Ne svidas mi se")
                })
            });

            schema.getType("SecurityApiTokens") &&
                schema.extend("SecurityApiTokens", fields => {
                    return {
                        ...fields,
                        invalidate: {
                            type: GraphQLString,
                            description: "Added by MyApp to invalidate tokens.",
                            resolve() {
                                return "Token has been invalidated!";
                            }
                        }
                    };
                });

            next();
        }
    };
github webiny / webiny-js / packages / webiny-api-cms / src / entities / Page / Page.graphql.js View on Github external
fields: () => ({
        id: { type: GraphQLID },
        createdOn: { type: GraphQLDateTime },
        title: { type: GraphQLString },
        slug: { type: GraphQLString },
        settings: { type: GraphQLJSON },
        content: { type: GraphQLJSON },
        category: { type: schema.getType(CategoryType.name) },
        status: { type: GraphQLString },
        activeRevision: { type: schema.getType(RevisionType.name) },
        lastRevision: { type: schema.getType(RevisionType.name) },
        revisions: { type: new GraphQLList(schema.getType(RevisionType.name)) },
    })
});
github webiny / webiny-js / packages / webiny-api-cms / src / entities / Revision / Revision.graphql.js View on Github external
fields: () => ({
        id: { type: GraphQLID },
        createdOn: { type: GraphQLDateTime },
        name: { type: GraphQLString, description: "Revision name" },
        title: { type: GraphQLString, description: "Page title" },
        slug: { type: GraphQLString },
        settings: { type: GraphQLJSON },
        content: { type: GraphQLJSON },
        published: { type: GraphQLBoolean},
        locked: { type: GraphQLBoolean},
        page: { type: schema.getType(PageType.name) }
    })
});
github webiny / webiny-js / packages / webiny-api-cms / src / entities / Page / Page.graphql.js View on Github external
fields: () => ({
        id: { type: GraphQLID },
        createdOn: { type: GraphQLDateTime },
        title: { type: GraphQLString },
        slug: { type: GraphQLString },
        settings: { type: GraphQLJSON },
        content: { type: GraphQLJSON },
        category: { type: schema.getType(CategoryType.name) },
        status: { type: GraphQLString },
        activeRevision: { type: schema.getType(RevisionType.name) },
        lastRevision: { type: schema.getType(RevisionType.name) },
        revisions: { type: new GraphQLList(schema.getType(RevisionType.name)) },
    })
});
github webiny / webiny-js / packages / webiny-api-cms / src / entities / Page / Page.graphql.js View on Github external
fields: () => ({
        id: { type: GraphQLID },
        createdOn: { type: GraphQLDateTime },
        title: { type: GraphQLString },
        slug: { type: GraphQLString },
        settings: { type: GraphQLJSON },
        content: { type: GraphQLJSON },
        category: { type: schema.getType(CategoryType.name) },
        status: { type: GraphQLString },
        activeRevision: { type: schema.getType(RevisionType.name) },
        lastRevision: { type: schema.getType(RevisionType.name) },
        revisions: { type: new GraphQLList(schema.getType(RevisionType.name)) },
    })
});