How to use the @webiny/commodo-graphql.resolveGet function in @webiny/commodo-graphql

To help you get started, we’ve selected a few @webiny/commodo-graphql 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 / api-page-builder / src / plugins / graphql / Page.js View on Github external
resolvers: {
        PbPage: {
            createdBy(page) {
                return { __typename: "SecurityUser", id: page.createdBy };
            },
            updatedBy(page) {
                return { __typename: "SecurityUser", id: page.updatedBy };
            }
        },
        PbElement: {
            preview({ preview }) {
                return preview ? { __typename: "File", id: preview } : null;
            }
        },
        PbQuery: {
            getPage: resolveGet(pageFetcher),
            listPages: listPages,
            listPublishedPages,
            getPublishedPage,
            getHomePage,
            getNotFoundPage,
            getErrorPage,
            listElements: resolveList(elementFetcher),
            searchTags: async (root: any, args: Object, context: Object, info: Object) => {
                const resolver = context.plugins.byName("pb-resolver-search-tags");

                return await resolver.resolve(root, args, context, info);
            },
            oembedData: oembed
        },
        PbMutation: {
            // Creates a new page
github webiny / webiny-js / packages / api-forms / src / plugins / graphql / form.js View on Github external
deleteForm(
                id: ID!
            ): FormDeleteResponse
            
            # Delete a single revision
            deleteRevision(
                id: ID!
            ): FormDeleteResponse
            
            # Logs a view of a form
            saveFormView(id: ID!): SaveFormViewResponse
        }
    `,
    resolvers: {
        FormsQuery: {
            getForm: resolveGet(getForm),
            listForms,
            listPublishedForms,
            getPublishedForm
        },
        FormsMutation: {
            // Creates a new form
            createForm: resolveCreate(getForm),
            // Deletes the entire form
            deleteForm: resolveDelete(getForm),
            // Creates a revision from the given revision
            createRevisionFrom: createRevisionFrom,
            // Updates revision
            updateRevision: resolveUpdate(getForm),
            // Publish revision (must be given an exact revision ID to publish)
            publishRevision: (_: any, args: Object, ctx: Object) => {
                args.data = { published: true };
github webiny / webiny-js / packages / api-files / src / plugins / graphql.js View on Github external
}
            `,
            resolvers: {
                File: {
                    __resolveReference(reference, context) {
                        return getFile(context).findById(reference.id);
                    }
                },
                Query: {
                    files: emptyResolver
                },
                Mutation: {
                    files: emptyResolver
                },
                FilesQuery: {
                    getFile: resolveGet(getFile),
                    listFiles: listFiles,
                    listTags: listTags,
                    isInstalled
                },
                FilesMutation: {
                    uploadFile,
                    uploadFiles,
                    createFile: resolveCreate(getFile),
                    updateFile: resolveUpdate(getFile),
                    createFiles,
                    deleteFile,
                    install
                }
            }
        },
        security: {
github webiny / webiny-js / packages / api-security / src / plugins / graphql / Role.js View on Github external
perPage: Int
                where: JSON
                sort: JSON
                search: SecurityRoleSearchInput
            ): SecurityRoleListResponse
        }

        extend type SecurityMutation {
            createRole(data: SecurityRoleInput!): SecurityRoleResponse
            updateRole(id: ID!, data: SecurityRoleInput!): SecurityRoleResponse
            deleteRole(id: ID!): SecurityRoleDeleteResponse
        }
    `,
    resolvers: {
        SecurityQuery: {
            getRole: resolveGet(roleFetcher),
            listRoles: resolveList(roleFetcher)
        },
        SecurityMutation: {
            createRole: resolveCreate(roleFetcher),
            updateRole: resolveUpdate(roleFetcher),
            deleteRole: resolveDelete(roleFetcher)
        }
    }
};
github webiny / webiny-js / packages / api-forms / src / plugins / graphql / formSubmission.js View on Github external
data: JSON!
                reCaptchaResponseToken: String
                meta: JSON
            ): FormSubmissionResponse
            
             exportFormSubmissions(
                ids: [ID] 
                parent: ID 
                form: ID 
            ): ExportFormSubmissionsResponse
        }
    `,
    resolvers: {
        FormsQuery: {
            listFormSubmissions: resolveList(getFormSubmission),
            getFormSubmission: resolveGet(getFormSubmission)
        },
        FormsMutation: {
            createFormSubmission,
            exportFormSubmissions
        }
    }
};
github webiny / webiny-js / packages / api-cms / src / plugins / graphql.js View on Github external
updateContentModel(id: ID!, data: ContentModelInput!): ContentModelResponse

                        deleteContentModel(id: ID!): CmsDeleteResponse
                    }
                `,
                resolvers: {
                    Query: {
                        cmsRead: emptyResolver,
                        cmsManage: emptyResolver
                    },
                    Mutation: {
                        cmsManage: emptyResolver
                    },
                    CmsManageQuery: {
                        getContentModel: resolveGet(contentModelFetcher),
                        listContentModels: resolveList(contentModelFetcher)
                    },
                    CmsManageMutation: {
                        createContentModel: resolveCreate(contentModelFetcher),
                        updateContentModel: resolveUpdate(contentModelFetcher),
                        deleteContentModel: resolveDelete(contentModelFetcher)
                    }
                }
            };
        },
        security: {
github webiny / webiny-js / packages / api-page-builder / src / plugins / graphql / Menu.js View on Github external
data: PbMenuInput!
            ): PbMenuResponse
            
            updateMenu(
                id: ID!
                data: PbMenuInput!
            ): PbMenuResponse
        
            deleteMenu(
                id: ID!
            ): PbDeleteResponse
        }
    `,
    resolvers: {
        PbQuery: {
            getMenu: resolveGet(menuFetcher),
            listMenus: resolveList(menuFetcher),
            getMenuBySlug: getMenuBySlug
        },
        PbMutation: {
            createMenu: resolveCreate(menuFetcher),
            updateMenu: resolveUpdate(menuFetcher),
            deleteMenu: resolveDelete(menuFetcher)
        }
    }
};
github webiny / webiny-js / packages / api-i18n / src / plugins / graphql / I18NLocale.js View on Github external
data: I18NLocaleInput!
            ): I18NLocaleResponse
            
            updateI18NLocale(
                id: ID!
                data: I18NLocaleInput!
            ): I18NLocaleResponse
        
            deleteI18NLocale(
                id: ID!
            ): I18NDeleteResponse
        }
    `,
    resolvers: {
        I18NQuery: {
            getI18NLocale: resolveGet(i18NLocaleFetcher),
            listI18NLocales: resolveList(i18NLocaleFetcher),
            searchLocaleCodes,
            getI18NInformation
        },
        I18NMutation: {
            createI18NLocale: resolveCreate(i18NLocaleFetcher),
            updateI18NLocale: resolveUpdate(i18NLocaleFetcher),
            deleteI18NLocale: resolveDelete(i18NLocaleFetcher)
        }
    }
};
github webiny / webiny-js / packages / api-security / src / plugins / graphql / User.js View on Github external
deleteUser(id: ID!): SecurityUserDeleteResponse
        }
    `,
    resolvers: {
        SecurityUser: {
            __resolveReference(reference, context) {
                return userFetcher(context).findById(reference.id);
            },
            avatar({ avatar }) {
                return avatar ? { __typename: "File", id: avatar } : null;
            }
        },
        SecurityQuery: {
            getCurrentUser: resolveGetCurrentUser,
            getUser: resolveGet(userFetcher),
            listUsers: resolveList(userFetcher)
        },
        SecurityMutation: {
            loginUsingIdToken: resolveLoginUsingIdToken(userFetcher),
            updateCurrentUser: resolveUpdateCurrentSecurityUser,
            createUser: resolveCreateUser(userFetcher),
            updateUser: resolveUpdateUser(userFetcher),
            deleteUser: resolveDeleteUser(userFetcher)
        }
    }
};
github webiny / webiny-js / packages / api-security / src / plugins / graphql / Group.js View on Github external
perPage: Int
                where: JSON
                sort: JSON
                search: SecurityGroupSearchInput
            ): SecurityGroupListResponse
        }

        extend type SecurityMutation {
            createGroup(data: SecurityGroupInput!): SecurityGroupResponse
            updateGroup(id: ID!, data: SecurityGroupInput!): SecurityGroupResponse
            deleteGroup(id: ID!): SecurityGroupDeleteResponse
        }
    `,
    resolvers: {
        SecurityQuery: {
            getGroup: resolveGet(groupFetcher),
            listGroups: resolveList(groupFetcher)
        },
        SecurityMutation: {
            createGroup: resolveCreate(groupFetcher),
            updateGroup: resolveUpdate(groupFetcher),
            deleteGroup: resolveDelete(groupFetcher)
        }
    }
};