glesys / butler-graphql

An opinionated GraphQL package for Laravel.
MIT License
34 stars 5 forks source link

feat: interface support #13

Closed wecc closed 5 years ago

wecc commented 5 years ago

Interfaces are now supported and their types are resolved using these methods in the following order:

  1. Look for $source['__typename'] if $source is an array.
  2. Look for $source->__typename if $source is an object.
  3. Try to call Parent@resolveTypeFor[Field]() where [Field] is the name of the field. (only resolveType() for queries and mutations).
  4. Use the base class name of $source if it's an object.

Closes #10