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

Allow passing rules directly into the graphql function #70

Open
asgoel opened this issue Dec 6, 2019 · 1 comment
Open

Allow passing rules directly into the graphql function #70

asgoel opened this issue Dec 6, 2019 · 1 comment
Assignees
Labels
pending Waiting for other issues to move forward upstream Should be solved or discussed upstream

Comments

@asgoel
Copy link

asgoel commented Dec 6, 2019

I wanted to add some custom validation rules in addition to the default graphql.specified_rules. Unless I'm mistaken, the only way to do so is to manually call validate with the new rules, which means that I basically have to duplicate all the code inside of async def graphql, and change the validation step in order to pass in my custom rules. Is it possible instead to just allow clients to pass the rules they want to use into the top-level graphql call?

@Cito
Copy link
Member

Cito commented Dec 6, 2019

@asgoel, thanks for reporting the issue.

As far as I see, you really need to build your own graphql() function to do that.

But I have forwarded your question to the issue tracker of GraphQL.js - maybe they have an idea or will add such an argument to the graphql() function (graphql/graphql-js#2278) - please join the discussion there as well. The preferred way to get new features into graphql-core is to get them into the reference implementation GraphQL.js, of which graphql-core is a port. That way everyone will benefit and graphql-core stays compatible.

@Cito Cito self-assigned this Dec 6, 2019
@Cito Cito added the pending Waiting for other issues to move forward label Dec 6, 2019
@Cito Cito added the upstream Should be solved or discussed upstream label Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending Waiting for other issues to move forward upstream Should be solved or discussed upstream
Projects
None yet
Development

No branches or pull requests

2 participants