Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
data: RoleInput!
): 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)
}
}
};
data: TagInput!
): 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)
}
}
};
deleteUser(id: ID!): SecurityUserDeleteResponse
}
`,
resolvers: {
SecurityUser: {
__resolveReference(reference, context) {
return userFetcher(context).findById(reference.id);
},
avatar(user) {
return { __typename: "File", id: user.avatar };
}
},
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)
}
}
};
data: GroupInput!
): 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)
}
}
};
data: PbMenuInput!
): PbMenuResponse
updateMenu(
id: ID!
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)
}
}
};
data: FileInput!
): FileResponse
updateFileBySrc(
src: String!
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)
}
}
};
data: PbCategoryInput!
): 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)
}
}
};
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)
}
};
data: RoleInput!
): 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)
}
}
};
data: ApiTokenInput!
): 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)
}
}
};