Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Allow interface type to be used when no fragments #210

Merged
merged 1 commit into from
Mar 5, 2019
Merged

Allow interface type to be used when no fragments #210

merged 1 commit into from
Mar 5, 2019

Conversation

whostolebenfrog
Copy link
Contributor

This addresses a bug where querying for an interface type without fragments blows up.

I think this is pretty valid - whilst you sometimes want to query with fragments and thus choose one of the implementations of that interface to query I also think it's very valid to query for just the fields on the interface and not choose to extend it to one of the implementations. This does however require that your node has the label of the interface (otherwise there is no label to query on). But that seems pretty reasonable.

Right now I think this is especially important as there seem to be a few other issues around inline fragment support.

I also note there are a few lines of code around these two that don't seem to do anything. Also that const implementationName is just a copy of interfaceLabel at this point. The const on the line below is also seemingly not used. I decided not to do anything with these as I was a bit unsure if they were part of a plan for further interface support. Hope that's OK!

Let me know if this needs any more work.

Thanks!

@johnymontana
Copy link
Contributor

Thanks @whostolebenfrog this looks good to me and yes I agree querying an interface type directly should be supported.

We're planning some work on interface and union types soon so this will be cleaned up a bit at that point.

@johnymontana johnymontana merged commit ec0fc67 into neo4j-graphql:master Mar 5, 2019
@whostolebenfrog
Copy link
Contributor Author

Thanks @johnymontana :-)

The work on interface types and union types sounds very interesting - that's right in our critical path at the moment so a big thumbs up from us thanks! Are you able to share what you're thinking?

@smkhalsa
Copy link
Contributor

@johnymontana can you share what you guys are working on with respect to Union and Interface types?

@smkhalsa
Copy link
Contributor

smkhalsa commented Apr 1, 2019

@johnymontana Is there anything I can do to help push Union / Interface types along?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants