elide icon indicating copy to clipboard operation
elide copied to clipboard

Add GraphQL inheritance/interface support

Open aklish opened this issue 5 years ago • 1 comments

Description

JSON-API supports model inheritance because it is not strongly typed. This PR enabled GraphQL to support model inheritance through GraphQL interfaces.

The PR also fixes scenarios where client errors were causing the Elide server to return 500 errors.

Motivation and Context

This PR allows the GraphQL API to request subclass fields through inline fragments like:

{ character { edges { node
{ __typename ... on Character { name } __typename ... on Droid { primaryFunction } } } } }

The following features are not supported:

  • Filtering a super class collection on sub class fields.
  • Sorting a super class collection on sub class fields.

How Has This Been Tested?

New IT tests in InheritanceIT

License

I confirm that this contribution is made under an Apache 2.0 license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

aklish avatar May 06 '20 18:05 aklish

Coverage Status

Coverage decreased (-0.3%) to 80.128% when pulling e0bd2f25e8d7d28148b7d8c5b4053f85c3e05f96 on AddGraphQLInterfaceSupport into ae30c5b3fc023af596dc421c44b65af05912f631 on elide-5.x.

coveralls avatar May 06 '20 20:05 coveralls