Skip to content

Inline Fragments for interfaces (attempt #1) - #133

Closed
bzbetty wants to merge 3 commits into
EntityGraphQL:masterfrom
bzbetty:union
Closed

bzbetty wants to merge 3 commits into
EntityGraphQL:masterfrom
bzbetty:union

Conversation

@bzbetty

@bzbetty bzbetty commented Jun 15, 2022

Copy link
Copy Markdown
Contributor

So this isn't ideal but it was the first method I got to work.

Essentially it allows this

query {
    animals {
        name
        ... on Cat {
            lives 
        }
        ...on Dog {
            hasBone 
        }
    }
}

however it will include all the properties on all types, but as the default value if it doesn't exist on that type. (eg Dogs will have 0 lives and Cats will have !hasBone).

I'm also trying another method which involves updating MakeSelectWithDynamicType to include Expression.Switch that check the types, but as always Expression Trees are quite hard to work with.

@bzbetty bzbetty changed the title Inline Fragments for interfaces Inline Fragments for interfaces (attempt #1) Jun 15, 2022
@bzbetty bzbetty closed this Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant