graphpql / graphpinator

:zap::globe_with_meridians::zap: Easy-to-use & Fast GraphQL server implementation for modern PHP. Includes features from latest draft, middleware directives and modules with extra functionality.

Home Page:https://github.com/graphpql

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Directive possibleTypes

peldax opened this issue · comments

Directive possibleTypes to specify type associated with ID parameter.

Inspired by github API:

"""
Defines what type of global IDs are accepted for a mutation argument of type ID.
"""
directive @possibleTypes(
  """
  Abstract type of accepted global ID
  """
  abstractType: String

  """
  Accepted types of global IDs.
  """
  concreteTypes: [String!]!
) on INPUT_FIELD_DEFINITION

Pre-Resolver could be added so graphpinator automatically selects item from database and passes it to resolve function instead of string ID.