How to use the webiny-api/graphql.schema.addType 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 / webiny-api-cms / src / graphql.js View on Github external
export const createCmsField = () => {
    schema.addType(CategoryType);
    schema.addType(CategoryQueryType);
    schema.addType(PageType);
    schema.addType(PageQueryType);
    schema.addType(RevisionType);
    schema.addType(RevisionQueryType);

    // Create Cms field to group related types and fields
    const CmsType = new GraphQLObjectType({
        name: "Cms",
        fields: () => ({
            Categories: createCategoryQueryField(),
            Pages: createPageQueryField(),
            Revisions: createRevisionQueryField()
        })
    });

    schema.addType(CmsType);
github webiny / webiny-js / packages / webiny-api-cms / src / graphql.js View on Github external
export const createCmsField = () => {
    schema.addType(CategoryType);
    schema.addType(CategoryQueryType);
    schema.addType(PageType);
    schema.addType(PageQueryType);
    schema.addType(RevisionType);
    schema.addType(RevisionQueryType);

    // Create Cms field to group related types and fields
    const CmsType = new GraphQLObjectType({
        name: "Cms",
        fields: () => ({
            Categories: createCategoryQueryField(),
            Pages: createPageQueryField(),
            Revisions: createRevisionQueryField()
        })
    });

    schema.addType(CmsType);

    // Add root query field
    schema.addQueryField({
github webiny / webiny-js / packages / webiny-api-cms / src / graphql.js View on Github external
export const createCmsField = () => {
    schema.addType(CategoryType);
    schema.addType(CategoryQueryType);
    schema.addType(PageType);
    schema.addType(PageQueryType);
    schema.addType(RevisionType);
    schema.addType(RevisionQueryType);

    // Create Cms field to group related types and fields
    const CmsType = new GraphQLObjectType({
        name: "Cms",
        fields: () => ({
            Categories: createCategoryQueryField(),
            Pages: createPageQueryField(),
            Revisions: createRevisionQueryField()
        })
    });

    schema.addType(CmsType);
github webiny / webiny-js / packages / webiny-api-cms / src / graphql.js View on Github external
export const createCmsField = () => {
    schema.addType(CategoryType);
    schema.addType(CategoryQueryType);
    schema.addType(PageType);
    schema.addType(PageQueryType);
    schema.addType(RevisionType);
    schema.addType(RevisionQueryType);

    // Create Cms field to group related types and fields
    const CmsType = new GraphQLObjectType({
        name: "Cms",
        fields: () => ({
            Categories: createCategoryQueryField(),
            Pages: createPageQueryField(),
            Revisions: createRevisionQueryField()
        })
    });

    schema.addType(CmsType);

    // Add root query field
    schema.addQueryField({
        name: "Cms",
github webiny / webiny-js / packages / webiny-api-cms / src / graphql.js View on Github external
export const createCmsField = () => {
    schema.addType(CategoryType);
    schema.addType(CategoryQueryType);
    schema.addType(PageType);
    schema.addType(PageQueryType);
    schema.addType(RevisionType);
    schema.addType(RevisionQueryType);

    // Create Cms field to group related types and fields
    const CmsType = new GraphQLObjectType({
        name: "Cms",
        fields: () => ({
            Categories: createCategoryQueryField(),
            Pages: createPageQueryField(),
            Revisions: createRevisionQueryField()
        })
    });
github webiny / webiny-js / packages / webiny-api-cms / src / graphql.js View on Github external
schema.addType(PageType);
    schema.addType(PageQueryType);
    schema.addType(RevisionType);
    schema.addType(RevisionQueryType);

    // Create Cms field to group related types and fields
    const CmsType = new GraphQLObjectType({
        name: "Cms",
        fields: () => ({
            Categories: createCategoryQueryField(),
            Pages: createPageQueryField(),
            Revisions: createRevisionQueryField()
        })
    });

    schema.addType(CmsType);

    // Add root query field
    schema.addQueryField({
        name: "Cms",
        type: CmsType,
        resolve() {
            return CmsType;
        }
    });
};
github webiny / webiny-js / packages / webiny-api-cms / src / graphql.js View on Github external
export const createCmsField = () => {
    schema.addType(CategoryType);
    schema.addType(CategoryQueryType);
    schema.addType(PageType);
    schema.addType(PageQueryType);
    schema.addType(RevisionType);
    schema.addType(RevisionQueryType);

    // Create Cms field to group related types and fields
    const CmsType = new GraphQLObjectType({
        name: "Cms",
        fields: () => ({
            Categories: createCategoryQueryField(),
            Pages: createPageQueryField(),
            Revisions: createRevisionQueryField()
        })
    });

    schema.addType(CmsType);

    // Add root query field