How to use the webiny-api/graphql.resolveCreate 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 / plugins / graphql / Page.js View on Github external
},
        PageBuilderQuery: {
            getPage: resolveGet(pageFetcher),
            listPages: listPages(pageFetcher),
            listPublishedPages,
            getPublishedPage,
            getHomePage,
            getNotFoundPage,
            getErrorPage,
            listElements: resolveList(elementFetcher),
            searchTags: searchTags,
            oembedData: oembed
        },
        PageBuilderMutation: {
            // Creates a new page
            createPage: resolveCreate(pageFetcher),
            // Deletes the entire page
            deletePage: resolveDelete(pageFetcher),
            // Sets given page as home page.
            setHomePage,
            // Creates a revision from the given revision
            createRevisionFrom: createRevisionFrom(pageFetcher),
            // Updates revision
            updateRevision: resolveUpdate(pageFetcher),
            // Publish revision (must be given an exact revision ID to publish)
            publishRevision: (_: any, args: Object, ctx: Object, info: Object) => {
                args.data = { published: true };

                return resolveUpdate(pageFetcher)(_, args, ctx, info);
            },
            // Delete a revision
            deleteRevision: resolveDelete(pageFetcher),
github webiny / webiny-js / packages / webiny-api-cms / src / plugins / graphql / Page.js View on Github external
// Sets given page as home page.
            setHomePage,
            // Creates a revision from the given revision
            createRevisionFrom: createRevisionFrom(pageFetcher),
            // Updates revision
            updateRevision: resolveUpdate(pageFetcher),
            // Publish revision (must be given an exact revision ID to publish)
            publishRevision: (_: any, args: Object, ctx: Object, info: Object) => {
                args.data = { published: true };

                return resolveUpdate(pageFetcher)(_, args, ctx, info);
            },
            // Delete a revision
            deleteRevision: resolveDelete(pageFetcher),
            // Creates a new element
            createElement: resolveCreate(elementFetcher),
            // Updates an element
            updateElement: resolveUpdate(elementFetcher),
            // Deletes an element
            deleteElement: resolveDelete(elementFetcher)
        },
        PageBuilderPageSettings: {
            _empty: () => ""
        }
    }
};
github webiny / webiny-js / packages / webiny-api-security / src / plugins / graphql / Group.js View on Github external
id: ID!
                data: GroupInput!
            ): GroupResponse
        
            deleteGroup(
                id: ID!
            ): DeleteResponse
        }
    `,
    resolvers: {
        SecurityQuery: {
            getGroup: resolveGet(groupFetcher),
            listGroups: resolveList(groupFetcher)
        },
        SecurityMutation: {
            createGroup: resolveCreate(groupFetcher),
            updateGroup: resolveUpdate(groupFetcher),
            deleteGroup: resolveDelete(groupFetcher)
        }
    }
};
github webiny / webiny-js / packages / webiny-api-security / src / plugins / graphql / User.js View on Github external
}
        },
        SecurityQuery: {
            getCurrentUser: resolveGetCurrentSecurityUser(userFetcher),
            getCurrentUserSettings: resolveGetCurrentSecurityUserSettings(userSettingsFetcher),
            getUser: resolveGet(userFetcher),
            listUsers: resolveList(userFetcher)
        },
        SecurityMutation: {
            loginUser: resolveLoginSecurityUser(userFetcher),
            loginUsingToken: resolveLoginUsingToken(userFetcher),
            updateCurrentUser: resolveUpdateCurrentSecurityUser(userFetcher),
            updateCurrentUserSettings: resolveUpdateCurrentSecurityUserSettings(
                userSettingsFetcher
            ),
            createUser: resolveCreate(userFetcher),
            updateUser: resolveUpdate(userFetcher),
            deleteUser: resolveDelete(userFetcher)
        }
    }
};
github webiny / webiny-js / packages / webiny-api-security / src / plugins / graphql / Role.js View on Github external
id: ID!
                data: RoleInput!
            ): RoleResponse
        
            deleteRole(
                id: ID!
            ): DeleteResponse
        }
    `,
    resolvers: {
        SecurityQuery: {
            getRole: resolveGet(roleFetcher),
            listRoles: resolveList(roleFetcher)
        },
        SecurityMutation: {
            createRole: resolveCreate(roleFetcher),
            updateRole: resolveUpdate(roleFetcher),
            deleteRole: resolveDelete(roleFetcher)
        }
    }
};
github webiny / webiny-js / packages / webiny-api-files / src / plugins / graphql / file.js View on Github external
data: FileInput!
            ): FileResponse
        
            deleteFile(
                id: ID!
            ): DeleteResponse
        }
    `,
    resolvers: {
        FilesQuery: {
            getFile: resolveGet(fileFetcher),
            listFiles: listFiles(fileFetcher),
            listTags: listTags(fileFetcher)
        },
        FilesMutation: {
            createFile: resolveCreate(fileFetcher),
            updateFileBySrc: updateFileBySrc(fileFetcher),
            deleteFile: resolveDelete(fileFetcher)
        }
    }
};
github webiny / webiny-js / packages / webiny-api-page-builder / src / plugins / graphql / Menu.js View on Github external
data: PbMenuInput!
            ): PbMenuResponse
        
            deleteMenu(
                id: ID!
            ): PbDeleteResponse
        }
    `,
    resolvers: {
       PbQuery: {
            getMenu: resolveGet(menuFetcher),
            listMenus: resolveList(menuFetcher),
            getMenuBySlug: getMenuBySlug(menuFetcher)
        },
       PbMutation: {
            createMenu: resolveCreate(menuFetcher),
            updateMenu: resolveUpdate(menuFetcher),
            deleteMenu: resolveDelete(menuFetcher)
        }
    }
};
github webiny / webiny-js / packages / webiny-api-security / src / plugins / graphql / User.js View on Github external
): DeleteResponse
        }
    `,
    resolvers: {
        SecurityQuery: {
            getCurrentUser: resolveGetCurrentUser(userFetcher),
            getCurrentUserSettings: resolveGetCurrentUserSettings(userSettingsFetcher),
            getUser: resolveGet(userFetcher),
            listUsers: resolveList(userFetcher)
        },
        SecurityMutation: {
            loginUser: resolveLoginUser(userFetcher),
            loginUsingToken: resolveLoginUsingToken(userFetcher),
            updateCurrentUser: resolveUpdateCurrentUser(userFetcher),
            updateCurrentUserSettings: resolveUpdateCurrentUserSettings(userSettingsFetcher),
            createUser: resolveCreate(userFetcher),
            updateUser: resolveUpdate(userFetcher),
            deleteUser: resolveDelete(userFetcher)
        }
    }
};
github webiny / webiny-js / packages / webiny-security / src / api / plugins / graphql / ApiToken.js View on Github external
createApiToken: async (...args: Array) => {
                const res = await resolveCreate(apiTokenFetcher)(...args);
                await res.data.generateJWT();
                return res;
            },
            updateApiToken: resolveUpdate(apiTokenFetcher),
github webiny / webiny-js / packages / webiny-api-page-builder / src / plugins / graphql / Category.js View on Github external
id: ID!
                data: PbCategoryInput!
            ): PbCategoryResponse
        
            deleteCategory(
                id: ID!
            ): PbDeleteResponse
        }
    `,
    resolvers: {
       PbQuery: {
            getCategory: resolveGet(categoryFetcher),
            listCategories: resolveList(categoryFetcher)
        },
       PbMutation: {
            createCategory: resolveCreate(categoryFetcher),
            updateCategory: resolveUpdate(categoryFetcher),
            deleteCategory: resolveDelete(categoryFetcher)
        }
    }
};