Currently, I am working on developing a GraphQL application and facing a challenge with my GQL type definitions.
organization: {
type: OTCompany,
astNode: fieldDefinitionAST(OTCompany.name, 'organization', [authDirective()]),
description: 'The organization associated with the campaign',
},
initiatedBy: {
type: OTUser,
astNode: fieldDefinitionAST(OTUser.name, 'initiatedBy', [authDirective()]),
description: 'The user who initiated the campaign',
},
In the code snippet above, you can observe that there is a repeating string value that matches the field name it is related to - organization
and initiatedBy
. It seems challenging to automate this value without relying on fragile string references. Does anyone have any innovative ideas for solving this issue?