Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible invalid return type for ObjectTypeComposer.getRelations #291

Closed
danez opened this issue Sep 23, 2020 · 3 comments
Closed

Possible invalid return type for ObjectTypeComposer.getRelations #291

danez opened this issue Sep 23, 2020 · 3 comments
Labels

Comments

@danez
Copy link

danez commented Sep 23, 2020

I was looking at the code to fix an issue in graphql-compose-mongoose and noticed that the return type for ObjectTypeComposer.getRelations is possibly wrong.

It is currently defined as ObjectTypeComposerRelationThunkMap, but nowhere in the code I can see that ObjectTypeComposer. _gqcRelations (which has the same type) gets thunks added. I think that It should be a normal map of relationName => options.

I could be of course mistaken, but I checked all usages of _gqcRelations and didn't see any thunk related code. I see that fields have a proxy/thunk thing going on but that never touches relations I think.

I can create a PR if someone can confirm this.

https://github.com/graphql-compose/graphql-compose/blob/master/src/ObjectTypeComposer.js#L1710
https://github.com/graphql-compose/graphql-compose/blob/master/src/ObjectTypeComposer.js#L215

@nodkz nodkz closed this as completed in db69087 Sep 23, 2020
@nodkz
Copy link
Member

nodkz commented Sep 23, 2020

@danez yep, you are right! 👍
I fixed it by myself for speeding up PR for graphql-compose-mongoose.
A new GC package will be published in a couple of minutes.

Tnx a lot!

@github-actions
Copy link

🎉 This issue has been resolved in version 7.21.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@danez
Copy link
Author

danez commented Sep 23, 2020

Wow that was fast thanks.

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

No branches or pull requests

2 participants