GraphQL WG ·

GraphQL WG meetings · Jump to notes

Agenda

View agenda on GitHub

GraphQL WG – January 2023 (Secondary, EU)

The GraphQL Working Group meets regularly to discuss changes to the GraphQL Specification and other core GraphQL projects. This is an open meeting in which anyone in the GraphQL community may attend.

This is a secondary meeting, timed to be acceptable for those in European timezones, which typically meets on the third Thursday of the month. The primary meeting is preferred for new agenda, where this meeting is for overflow agenda items, follow ups from the primary meeting, or agenda introduced by those who could not make the primary meeting time.

Attendees

NameGitHubOrganizationLocation
Lee Byron (Host)@leebyronGraphQL FoundationSan Francisco, CA, US
Michael Staib@michaelstaibChilliCreamZurich, CH
Rob Richard@robrichard1stDibsJersey City, NJ, US
Roman Ivantsov@rivantsovIndividualSeattle, WA, US
Benjie Gillam@benjieGraphileChandler's Ford, UK
Benoit Lubek@bodApolloLyon, FR
Hugh Willson@hwillsonApolloManotick, ON, CA
Yaacov Rydzinski@yaacovCRIndividualNeve Daniel, IL
Matt Mahoney@mjmahoneMetaNew York, NY, US
Ivan Goncharov@IvanGoncharovApolloLviv, UA

Agenda

  1. Agree to Membership Agreement, Participation & Contribution Guidelines and Code of Conduct (1m, Lee)
  2. Introduction of attendees (5m, Lee)
  3. Determine volunteers for note taking (1m, Lee)
  4. Review agenda (2m, Lee)
  5. Review prior primary meeting (5m, Lee)
  6. Review previous meeting's action items (5m, Lee)
  7. Defer/Stream updates (20m, Rob)
  8. Discussion of Backward Compatibility (20m, Roman)

Notes

View notes on GitHub

GraphQL WG Notes - Jan 2023

Watch the replays: GraphQL Working Group Meetings on YouTube

Primary meeting

Agenda

Determine volunteers for note taking (1m, Lee)

  • Benjie
  • Hugh

Review agenda (2m, Lee)

  • TSC nominations have closed; we’re going to kick off voting soon (virtually).

Review prior secondary meetings (5m, Lee)

  • WG secondary APAC
    • Discussion around legals of GraphQL scalars project - action on Lee to advance
    • Discussions around Roman’s various PRs (more on that later)
  • WG secondary EU
    • Validation of variables
    • Adding style guides to the spec
    • Another step forward on defer/stream; to be discussed further today

Review previous meeting's action items (5m, Lee)

Updates on Fragment Arguments (15m, Matt)

  • Updated Spec PR to include spec text changes
  • Updated graphql-js with working implementation and validation
  • Discuss whether Fragment Arguments PR is ready for Stage 2: Draft.
  • Matt: Fragments don’t give you a way to reuse them in different contexts - e.g. a fancy component in React could have N of my friends in a list. In GraphQL I either have to push the logic up to where the query is or hard-code a value to decide how many friends I want to show. Relay has non-spec-compliant directives (@arguments(nFriends: 10)) - types that can’t be described in GraphQL’s type system.
  • Desire is to bring fragment arguments into the spec to get rid of non-spec-compliant directives system from Relay. I’d have been happy with just adding the AST nodes, but pushback was that the executor should understand them, so this RFC addresses this.
  • Define fragment arguments in similar ways to variables definition (fragment FriendsList($nFriends:Int!) …), but when you call them it’s like arguments to a field ...FriendsList(nFriends: $someVar).
  • Lee: it might be easier to think of them as “fragment variables” rather than “fragment arguments” - they behave like variables inside the fragment.
  • Matt: when dealing with validation, I wanted the AST to be more like “input values” - these are almost identical to variable definitions, except they have no dollar.
  • Lee: it’s kind of both - an argument is a property of how it is called. “Fragment variables operate like operation variables; you provide operation variables by passing them in the GraphQL request, you provide fragment variables by passing as an argument to the fragment spread”
  • Matt: scope of fragment variables is local to the fragment only - they are not inherited by child fragment spreads; variables can be shadowed.
  • Lee: variables defined in fragment are considered first, in the operation later. We don’t need to track a stack of variables.
  • Matt: this also prevents independent fragments being used in the same document from introducing new constraints on those fragments.
  • ACTION - Matt: switch from “argument definitions” to “variable definitions” (using args at the call site still) in a stacked PR
  • Ivan: will you be adding a validation rule in Facebook to prevent shadowing? Also, consider using a different symbol such as $$ to make it clear it’s fragment local and to allow consistent syntax.
  • Matt: it’s not shadowing within a function [...] Within Meta we would not add this kind of validation.
  • Ivan: if you’re expecting some more validations to come, could you add them to the document?
  • Matt: I feel this is close to RFC 2 now.
  • Lee: I think you probably are at Stage 2. Would be good to separate out the RFC doc from the spec edits to keep the PR clean.
  • Looks good, choices seem reasonable, would be nice to list out a TODO list of the open questions that still need resolving.
  • Lee: not quite stage 2 because we’ve not resolved all the challenges, but we’re very close!
  • Hugh: Apollo Client would love to work with you on this
  • Rob: same fragment spread in the same place with different arguments would be a validation error?
  • [discussion - consensus: TBD]
  • Roman: we should be forgiving and accept what the programmer tells us, do our best to merge
  • Matt: we’ve found that it’s almost always unintentional with fields - typically when two teams add different
  • ACTION - Matt: figure out and document what all the challenges are that need to be resolved

Review of pending approved PRs (15m, Roman)

  • making this regular part of agenda
  • PRs ready to go:
  • Calling for action to:
  • Roman: having PRs open for a long time after being accepted is frustrating - can we review them each month and get them merged?
  • Lee: editorial PRs shouldn’t need to wait on me; if something is obviously ready to merge and non-controversial then TSC members should be able to merge them.
  • Roman: the other items I’d like to draw your attention to.
  • Ivan: for non-editorial changes, having a champion is a good thing, we shouldn’t change the process here.
  • Lee: if a TSC member approves something that they believe is editorial then they can merge it, if they think it needs more discussion they can ping TSC.
    • When you approve, add a line of text detailing what the next action should be: are you waiting on more approvals? Does Lee need to review it? Etc. At least this way it will be clear whose fault it is for not taking the next action.
    • It’s entirely reasonable to want two sets of eyes on each thing.

Default Value Validation Status Check (15m, Yaacov)

  • Lee's original PR stack
  • Now rebased on main
  • Reference from 2021
  • Yaacov: I’ve rebased all your hard work, Lee. Last discussed Sept 2021.
  • Benjie [chat]: https://github.com/graphql/graphql-wg/issues/879
  • Benjie: there’s also the spec work that I think needs to be re-edited to mirror what the JS implementation does because I think you changed approach?
  • Lee: it’s waiting on me then.
  • Ivan: we’ll try and extract any non-spec changes to make the PR smaller. Last time I tried to understand it, it was pretty complex. One thing to make the review easier might be to see what Andi did in GraphQL-Java - did he encounter any issues? Did he do the GraphQL.js code or the spec text?
  • Yaacov: schema coordinates are tied into that, is that ready to go?
  • Lee: hopefully they can be separated.

Updates on defer/stream (15m, Rob)

  • Proposal to merge deferred fragments
  • Rob: we had another breakout meeting shortly before the holidays. We’re meeting again on Monday
  • Recap:
    • Clients being unable to tell if a fragment was deferred or not is still the main issue.
    • Generally people aren’t happy with labels, so we’re looking for ways to drop it, if possible.
    • In GraphQL we can branch execution on fields via aliases, but we don’t have that same option for fragments (at least not yet).
    • General consensus: non-aliased fragments that are deferred should be merged.
  • Lee: are you completely removing label, or just making it very optional?
  • Rob: dropping it entirely, and it can be solved either via fragment aliases or by aliasing the parent field.
  • Michael: label was never enough for what we wanted to do anyway, so it feels not right to have the label there.
  • Lee: we can always add functionality that results in multiple payloads instead of one - it’s always better to start with fewer payloads, simpler. In future we might consider priority and other options, so I’m in favor with this merging.
  • Michael: the aggressive merging feels more GraphQL-y
  • Rob: complexity is not fetching things again just because they’re deferred.
  • Rob: you mentioned “id”, Lee, I’m not totally sold in either direction.

Secondary - APAC

Agenda

  1. Agree to Membership Agreement, Participation & Contribution Guidelines and Code of Conduct (1m, Lee)
  2. Introduction of attendees (5m, Lee)
  3. Determine volunteers for note taking (1m, Lee)
  4. Review agenda (2m, Lee)
  5. Review prior primary meeting (5m, Lee)
  6. Review previous meeting's action items (5m, Lee)
  7. Licensing & final legal sign-off for GraphQL Scalars project (5m, Donna)
  8. Fragment Arguments: Identify Open Concerns to Address (known concerns below) (10m, Matt)
    • Do we allow shadowing global variables?
    • PR with Variable Definitions instead of Fragment Argument Definitions.
    • Do we need PR Reviews to know if there are other concerns?
    • Maybe: additional graphql-js PR to use local scope, aka graphql-spec algorithm, rather than visit replacement?

Review Agenda

Review previous meeting's action items

  • Andi: Benjie had validation Q for default value handling, GraphQL Java now implements all default value validation
  • Andi: needed additional function for scalars value to AST
  • Influenced custom scalar work

Licensing & final legal sign-off for GraphQL Scalars project

  • Waiting for Lee
  • Spend time in meeting getting to done.
  • License:
    • MIT License (it’s code not spec text). Need to add that because scalars is code, but owfa is for spec text. Weird reasons why different. Need template about copyright person who wrote, but open to all
    • Andi: OWFA is ideal as mostly it’s spec, even though we have some code. Value is spec not code
    • Lee: Will say any code is MIT, any spec is OWFA. Will do this right after call
  • Donna: in custom scalars section of spec, could link to GraphQL Scalars
  • Andi: spread word, use it, look into it, let’s get value out of it
  • Lee: will pull down now

Fragment Arguments Open Concerns

  • Extra thing: open new PR to kill and make new one to help improve context
  • Discussion about how we do it on the client (expanding fragments as templates)
  • Worthwhile to treat runtime performance of validation steps as legitimate concern
    • Could we dream up degenerate text that causes perf issues? Does this create a new category of these things? Would be good to have a paragraph or two explaining why we aren’t worried about it.

Secondary - EU (2023-01-19)

Agenda

  1. Agree to Membership Agreement, Participation & Contribution Guidelines and Code of Conduct (1m, Lee)
  2. Introduction of attendees (5m, Lee)
  3. Determine volunteers for note taking (1m, Lee)
  4. Review agenda (2m, Lee)
  5. Review prior primary meeting (5m, Lee)
  6. Review previous meeting's action items (5m, Lee)
  7. Defer/Stream updates (20m, Rob)
  8. Discussion of Backward Compatibility (20m, Roman)

Review prior primary meeting

  • Talked about fragment arguments, need to resolve naming around arguments or variables
  • Discussion about PR’s for the spec being approved but not merged; when someone approves they should make the next steps clear, e.g. approved and should be merged, approved but needs more feedback from other TSC members, etc.
  • Default value validation status checks (https://github.com/graphql/graphql-js/pull/3814)
  • Defer/stream updates

Defer/Stream updates

  • Summary: clients identifying streams/defers being in progress/completed.
  • Rob: I've broken the #52 discussions up into separate issues.
    • Remove labels entirely #64
      • Ivan: If we have initial response and one big defer per path then you can live without labels, but labels are a nice feature - they make the client life easier and allow us to do more complicated stuff later.
      • Michael: I don't see the use cases for labels, could you expand?
      • Ivan: currently we'd only get one defer per path, but with labels you can ship data as you want and just mark when certain labels are resolved.
      • Michael: but it reintroduces all the label issues?
      • Ivan: we can use labels in a different way than what we proposed previously; I'll open a separate issue to discuss this.
      • Hugh: add them to #64
      • Yaacov [chat]: labels allow you to declare fulfillment of defers at the same path individually => but what we said previously is that we would enable this eventually with fragment aliases
      • Rob: a single defer could correspond to multiple responses, and the label would indicate once all the responses mean that that label is completed.
      • Ivan: exactly: server ships stuff when it's ready - shipping fields separately or batching - then label indicates that you have everything that you need to satisfy the fragment.
      • Michael: we're hoping to solve this with fragment aliasing instead, then you would not need the label.
      • Rob: the important thing to me here is changing the contract that you can have one defer per path.
      • Ivan: Apollo Kotlin works on a merged tree of all the payloads, it doesn't matter how it's received (which payloads have which fields) - it just matters if the data is complete or not [for a label].
      • Ivan: this proposal splits the idea of the label and the shape being paired - the shape can be split and delivered in multiple parts, and then signal when it's complete.
      • Ivan: reason: deduplication and allowing details at the same path to be resolved in different phases
      • Yaacov: but we may be able to solve that in different ways.
      • Ivan: you're right; deduplication is the main one for me.
    • Deduplication of deferred fields #65
    • Include an indication of upcoming payloads in response #66

Discussion of Backward Compatibility

  • Roman: Sometimes "backwards compatibility" gets in the way - if someone mentions that then it can stop progress..
  • Related discussion: https://github.com/graphql/graphql-wg/discussions/1232
  • Benjie: deprecated directive doesn’t mean the thing has to go away, or that there is going to be an incompatible change
  • Benjie: I do like the suggested new wording: “@directive directive helps to manage the gradual evolution of application schema, giving an advanced warning to clients about upcoming changes in the schema.”
  • Ivan: I suggest "deprecated" discourage usage in a new client and notify old client to migrate
    • so no mention of compatibility
    • because it's up to a server maintainer to decide on such a policy
  • Benjie: re: deprecated, it doesn't mean "it might go away," it means "avoid using this." It might mean that it's going to go away, but that's up to the schema implementer. It might just mean there's an alternative field/pattern to use instead.
  • Backwards compatibility explained in https://github.com/graphql/graphql-spec/blob/main/CONTRIBUTING.md#guiding-principles:
    • Once a query is written, it should always mean the same thing and return the same shaped result. Future changes should not change the meaning of existing schema or requests or in any other way cause an existing compliant GraphQL service to become non-compliant for prior versions of the spec.
    • Folks agree with this
  • Moving conversation to talk about suggested basic principles for advancing the spec (from Roman):
    1. Capabilities: do not remove, add only. Do not change, extend only
    2. Restrictions on existing elements: never add one, but removing restriction should be OK.
    3. Presumed some tolerance of implementations to unexpected extra elements - do we mention it in the spec?
    4. Primary concern with existing end apps and their GraphQL schemas and queries;
    5. Much less concern with libraries and tools, just publish spec draft early enough.
  • Yaacov: so that means there can never be any new GraphQL Types?....; That can't be interpreted by old GraphiQL as an old type?
  • Benjie: It's a should, so basically care must be taken. GraphiQL should ignore types it doesn't understand, in the same way that that apps should expect new types to be added to a union.; However changing that an input object is no longer input-only would be an unexpected change rather than a new type. In general a new type is actually preferred over tweaking existing types.
  • Ivan: Future changes should not change the meaning of existing schema
  • Benjie: conversation is getting a bit convoluted between backwards and forwards compatibility

Update on Fragment Arguments

Tracked RFCs