GraphQL | Add Ability to Update Custom Field using Definition Locator
We request that Administrate add the ability to use a definitionLocator Name to be used as an identifier for a CustomFieldValueInput in addition to the definitionKey which is the current required identifier.
The reason why this is needed is because the system provides the ability to specify a "unique API name". That should be able to be used for both queries and mutations, to allow it to be used for one and not the other is poor design.
The definitionKey can be used, but it means I have to either hard code the key value (which hopefully shouldn't change), or perform additional queries for the key value to then programmatically put it back into the mutation.
-
Official comment
Hey Steve,
Have you tried something like:
mutation cutomfieldsUpdates{ customFields{ updateGenericCustomFieldDefinition(input: { definitionId:"R2VuZXJpY0N1c3RvbUZpZWxkRGVmaW5pdGlvbjo2", definitionLocator:"hash_account_number_four" label:"Account Number" }) { errors { label message value } } } }
However, in terms of being able to actually use the definitionLocator as a unique identifier to update - it’s not intended to work this way and not planned
Comment actions
Please sign in to leave a comment.
Comments
2 comments