-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
3.0.1 Whitelisting is not working as expected when referencing your specs #136
Comments
Whoa, @IsaaX what an issue report! 🎉 I introduced Regarding your problem now, it's an implementation detail that is messing your code. I call it the GraphQL Schema contract - I'll also be posting an article about it, but for now you can read the idea in one of the recent issues. Long story short, it's the I hope this gives you some leads to your problem. Let me know if you need any help implementing it! 🙂 |
That makes complete sense and I had read that issue yesterday too! I didn't connect the dots, doh! I get what is happening now. So Ill close this and appreciate the quick response! RE: Templates Describe the bugA clear and concise description of what the bug is. To ReproduceSteps to reproduce the behavior, please provide code snippets or a repository:
type Query {
book: Book!
}
type Book {
id: ID!
name: String!
content: String!
}
book {
id
name
content
}
const permissions = shield({
Query: {
book: allow,
},
Book: {
content: deny,
},
})
Expected behaviorA clear and concise description of what you expected to happen. Actual behaviourIf applicable, add screenshots to help explain your problem. Additional contextAdd any other context about the problem here. |
Just changed! Great additions. Thank you for contributing 🎉 |
Bug report
Describe the bug
Hello, big fan of this package! Not sure if this is entirely a bug, could be an implementation detail I'm not understanding. With the latest 3.0.1 I'm trying out the
whitelist
option and I ran into this scenario and was wondering if this was a bug or not.To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
What I expected for this interactions (I was referencing your specs when deriving my example) https://github.com/maticzav/graphql-shield/pull/119/files#diff-6b51ffc4039e2d70d0a58c36b16f55dcR77
I was expecting to get a partial object with the
deny
fieldrole
would be returned as null, just like in the specs.Actual behaviour
I receive this input
Additional context
This seems to work fine if I nest another object into the currentUser, whitelist everything about currentUser, and
deny
that nested object in currentUser, I obtain the currentUser correctly and the nested object is returned asnull
.The text was updated successfully, but these errors were encountered: