GraphQL bugfixes and simplifications

This commit is contained in:
James
2020-05-19 08:47:50 -04:00
parent 698a66f583
commit de6aee192e
4 changed files with 8 additions and 17 deletions

View File

@@ -30,7 +30,7 @@ function buildPoliciesType() {
};
Object.values(this.config.collections).forEach((collection) => {
fields[collection.slug] = {
fields[formatName(collection.slug)] = {
type: new GraphQLObjectType({
name: formatName(`${collection.labels.singular}Policy`),
fields: buildFields(collection.labels.singular, ['create', 'read', 'update', 'delete']),
@@ -39,7 +39,7 @@ function buildPoliciesType() {
});
Object.values(this.config.globals).forEach((global) => {
fields[global.slug] = {
fields[formatName(global.slug)] = {
type: new GraphQLObjectType({
name: formatName(`${global.label}Policy`),
fields: buildFields(global.label, ['read', 'update']),