-
Notifications
You must be signed in to change notification settings - Fork 229
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
[2022-07-07] Open a discussion thread about meta-fields proposal #1055
Comments
@rivantsov @IvanGoncharov i want to add a note about directives, that we have 2 types of directives
So maybe better to add to directives a kind/type property:
Of course these directives type/kind names are debatable. And need to find better names. But from my point of view I see 3 types/kinds of directives which should be clarified in spec for different purposes. |
BTW Ouch, I just found a good word for distinguishing of 3 directive kinds - |
aren't these dir sub-types already covered by Location? |
Nope.
|
oh, no, that's one of the points I argued on several occasions. ALL directives should be exposed. There should be such thing as hidden directives |
Right now we have a mess in directives. Some directives are used in SDL, others in request language. Some directives are sensitive and should live only on server (eg @cypher neo4j-graphql or @inaccessible in apollo federation) According to this mess, instead of clarifying of directive scopes we start to invent meta-fields. If we provide ability to mark directives scope and a way to filter out some of them from introspection we will escape addition of meta-fields. About backwards compatibility: directive @some(arg: String) on FIELD will be acted like directive @some(arg: String) on FIELD scopes [request, server, client] Or we may leave just two types of scope for simplicity - [client, server]. But it's bad, because we don't distinguishing meta directives for informing clients as meta-fields (like So if developer explicitly provide scopes
then this directive will not be exposed via introspection. Because it does not have |
@nodkz I disagree in principle, while your solution is not necessarily bad.
but also
IMO these are conflicting. @IvanGoncharov has described very well the difference between directives and metadata. Two reflective questions are:
IMO, if I need to add all the directives I want to my schema, I would easily and quickly end with 10/15 directive per field. These include and do not limit to:
Moreover, most of them would not be added or managed by a developer, so actually they would require a third party to touch the schema file. Using metadata would allow the schema do be built and managed by an engineer and another party to be able to manage metadata on a different file without impacting the schema. I see more value in separating the whole metadata piece from the schema, and therefore, in strengthening the idea directives are there for guiding resolvers. Clear separation of concerns. |
I agree with pretty much everything @LunaticMuch has said, with the caveat that the metadata is part of the schema: it should be introspectable via the schema introspection, it should be representable in schema SDL, etc. Though you could define the metadata somewhere else during schema building (there are many ways to build a GraphQL schema), ultimately it will end up as part of the final schema. (This may or may not align with @LunaticMuch's intent.) |
@benjie we're aligned. I misrepresented my idea. Splitting files, it's just a convenient pattern, which is achievable today as well with current tools. Although, given the difference between directives and metadata, your schema should not break if, when it gets built, the metadata for a type is missing. This allow for clear separation. |
I could not find the discussion thread for this particular proposal; but there is one for Lee's proposal here: #1096 There's been no activity on this for over a year so I'll close it. |
Presentation: https://docs.google.com/presentation/d/1qGc2rZKeim699tT-2G1xDESZP3Kd6tvj9V27tQfyJhg/edit#slide=id.ge9d8d484d6_0_5
Video link to beginning of Ivan's topic: https://youtu.be/gVCszBu_aJI?t=2714
And to where the action items are discussed: https://youtu.be/gVCszBu_aJI?t=4850
Note: Action Item issues are reviewed and closed during Working Group
meetings.
The text was updated successfully, but these errors were encountered: