Open stubailo opened 8 years ago
I like adding custom rules for various reasons (maybe you're using a code generator that requires additional constraints)
I'm curious if the idea is to also exclude from this list, and if so are there common cases? Ideally we never exclude any of the specification rules, but if there's rationale for why you would want to disable one then perhaps we're missing something else.
Well, there's this:
In general, when you're dynamically putting together fragments/variables/etc, some of those won't be represented in the raw static query string.
Gotcha - yeah that's true. Using Relay results in some quirks. Though we should be able to add most of those back with better support in the tools.
Yeah I mean in my ideal GraphQL spec there would be better support for how "fancy" libraries should behave. For example, having the arguments for a mutation inside the query string:
http://docs.apollostack.com/apollo-client/core.html#mutate
It's not nice to have to type the arguments three times, when in theory all of the information is there to just type them twice.
It seems like currently GraphQL is optimized for the case where each query is a standalone chunk of logic that doesn't interact much with the surrounding code (declaring its own arguments being one example).
From this list, at first: https://github.com/graphql/graphql-js/blob/master/src/validation/specifiedRules.js
With more to come later! Eventually we should support defining custom rules.