du5rte / graphql-mongodb-projection

GraphQL mongoDB projections generator
MIT License
30 stars 11 forks source link

Fix issues with union type queries #7

Closed swissspidy closed 7 years ago

swissspidy commented 7 years ago

I'm working on a small app using GraphQL and MongoDB. While testing this handy package I noticed that it doesn't work well together with union types. I guess it's because of the additional nesting (... on AType, ... on BType).

This PR addresses this and adds some tests for it as well. The actual fix is just 1 changed line in infoToProjection().

It would be great if you could incorporate this and publish a new version on npm.

Thanks!

du5rte commented 7 years ago

All looks great thanks for finding this bug and submitting a fix :)

swissspidy commented 7 years ago

@du5rte Thanks for merging the PR! Would you mind publishing an update on npm as well? See https://docs.npmjs.com/getting-started/publishing-npm-packages#updating-the-package.

du5rte commented 7 years ago

@swissspidy done! thanks for the link, I hadn't done this in a while ...