Skip to content

Union support#2

Merged
andreas merged 3 commits intomasterfrom
union-support
Feb 26, 2018
Merged

Union support#2
andreas merged 3 commits intomasterfrom
union-support

Conversation

@andreas
Copy link
Copy Markdown
Owner

@andreas andreas commented Feb 3, 2018

This PR adds union support to ppx_graphql. The major caveat is that you need to add the field __typename manually to your query for this to work. In the future, this will happen automagically.

Example:

query {
  search(query:"topic:mirageos", type:REPOSITORY, first: 5) {
    node {
      __typename
      ...on Repository {
        nameWithOwner
      }
    }
  }
}

@mato
Copy link
Copy Markdown

mato commented Feb 6, 2018

Thanks @andreas. I can't comment on the implementation, but have tested this and it works for me!

- Add union support to ppx
- Updated test schema to include union type
- Add test cases for union type
@andreas andreas merged commit d6bb656 into master Feb 26, 2018
@andreas andreas deleted the union-support branch February 26, 2018 18:43
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.

2 participants