Skip to content

Commit

Permalink
fix(core): Fix startup error with readonly Administrator custom fields
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Jul 24, 2023
1 parent 9524add commit cae55a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/api/config/graphql-custom-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,11 @@ export function addActiveAdministratorCustomFields(
administratorCustomFields: CustomFieldConfig[],
) {
const schema = typeof typeDefsOrSchema === 'string' ? buildSchema(typeDefsOrSchema) : typeDefsOrSchema;
const writableCustomFields = administratorCustomFields?.filter(field => field.readonly !== true);
const extension = `
extend input UpdateActiveAdministratorInput {
customFields: ${
0 < administratorCustomFields?.length ? 'UpdateAdministratorCustomFieldsInput' : 'JSON'
0 < writableCustomFields?.length ? 'UpdateAdministratorCustomFieldsInput' : 'JSON'
}
}
`;
Expand Down

0 comments on commit cae55a6

Please sign in to comment.