Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createdBy(page) {
return { __typename: "SecurityUser", id: page.createdBy };
},
updatedBy(page) {
return { __typename: "SecurityUser", id: page.updatedBy };
}
},
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) => {
): ApiTokenResponse
updateApiToken(
id: ID!
data: ApiTokenInput!
): ApiTokenResponse
deleteApiToken(
id: ID!
): DeleteResponse
}`
],
resolvers: {
SecurityQuery: {
getApiToken: resolveGet(apiTokenFetcher),
listApiTokens: resolveList(apiTokenFetcher)
},
SecurityMutation: {
createApiToken: async (...args: Array) => {
const res = await resolveCreate(apiTokenFetcher)(...args);
await res.data.generateJWT();
return res;
},
updateApiToken: resolveUpdate(apiTokenFetcher),
deleteApiToken: resolveDelete(apiTokenFetcher)
}
}
};
): RoleResponse
updateRole(
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)
}
}
};
): GroupResponse
updateGroup(
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)
}
}
};
): GroupResponse
updateGroup(
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)
}
}
};
updateUser(
id: ID!
data: UserInput!
): UserResponse
deleteUser(
id: ID!
): 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)
}
}
};
updateRevision(
id: ID!
data: RevisionInput!
): RevisionResponse
publishRevision(
id: ID!
): RevisionResponse
deleteRevision(
id: ID!
): DeleteResponse
`,
queryResolvers: {
getRevision: resolveGet(revisionFetcher),
listRevisions: resolveList(revisionFetcher)
},
mutationResolvers: {
createRevisionFrom: createRevisionFrom(revisionFetcher),
updateRevision: resolveUpdate(revisionFetcher),
publishRevision: (_, args, ctx, info) => {
args.data = { published: true };
return resolveUpdate(revisionFetcher)(_, args, ctx, info);
},
deleteRevision: resolveDelete(revisionFetcher)
}
};
): TagResponse
updateTag(
id: ID!
data: TagInput!
): TagResponse
deleteTag(
id: ID!
): DeleteResponse
}
`,
resolvers: {
CmsQuery: {
getTag: resolveGet(tagFetcher),
listTags: resolveList(tagFetcher)
},
CmsMutation: {
createTag: resolveCreate(tagFetcher),
updateTag: resolveUpdate(tagFetcher),
deleteTag: resolveDelete(tagFetcher)
}
}
};
): RoleResponse
updateRole(
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)
}
}
};
): PbCategoryResponse
updateCategory(
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)
}
}
};