matters-server icon indicating copy to clipboard operation
matters-server copied to clipboard

GraphQL directive for ID validation

Open robertu7 opened this issue 3 years ago • 0 comments

Mutations that trying to mutate a node usually have an id: ID! in input, but we haven't validated the node type after fromGlobalId. We can add a directive and use it in schemas,

input ToggleRecommendInput {
  id: ID! @isNodeType(type: "${NODE_TYPES.Article}")
  enabled: Boolean!
  type: RecommendTypes
}

robertu7 avatar Apr 23 '21 09:04 robertu7