matters-server
matters-server copied to clipboard
GraphQL directive for ID validation
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
}