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

Graphql-shield not working properly with graphql-yoga and graphql-modules. #1321

Open
Tracked by #2700 ...
xoldd opened this issue Jun 27, 2022 · 1 comment
Open
Tracked by #2700 ...
Milestone

Comments

@xoldd
Copy link

xoldd commented Jun 27, 2022

Describe the bug

Graphql-shield does not seem to work with graphql-yoga and graphql-modules. I don't know where the issue is. I've reduced the implementation to a short version. Basically there are two query fields. One is protected by a graphql-shield rule and one is not. The one protected by the rule is not returning expected error response to the client. Please check it out.

Your Example Website or App

https://github.com/xoldyckk/yoga_shield_modules_error

Steps to Reproduce the Bug or Issue

Go to this github repo
Fork/download the project.
Run pnpm install(or npm if you prefer to).
Go to url http://0.0.0.0/graphiql.
Try making both query1 and query2 and match the responses as written in the resolver code. query2 is protected by graphql-shield rule so it should return an error. But it doesn't.

Expected behavior

I expected to get an errors array with the custom error I defined in graphql-shield rule as the result. But I get something else back as the error.

Screenshots or Videos

No response

Platform

  • OS: [Fedora Linux]
  • NodeJS: [18.4.0]
  • @graphql-yoga/* version(s): [e.g. 2.9.2]

Additional context

No response

@Urigo Urigo added this to the v3 milestone Jul 6, 2022
@theguild-bot theguild-bot mentioned this issue Jul 6, 2022
@Dreamystify
Copy link

Has this been resolved?

This was referenced May 7, 2024
This was referenced May 23, 2024
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

No branches or pull requests

2 participants