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

Proposal: GraphQL Composite Schemas Working Group #977

Merged
merged 7 commits into from Jun 2, 2022

Conversation

benjie
Copy link
Member

@benjie benjie commented May 23, 2022

There's a lot of different ways of combining multiple GraphQL schemas together to form a larger composite schema, and the wide variety of options can make it challenging to design schemas in a way that will be easy to compose later. To name but a few approaches:

  • Schema merging and stitching (various implementations in many languages)
  • GraphQL modules and other "extend type"-based approaches
  • Federation (Apollo's v1 and v2, Mercurius, WunderGraph, Hot Chocolate, etc)
  • Hasura's GraphQL Joins

Though these are all separate solutions to similar problems, there are various concerns that most of them have to consider:

  • Identifying the schemas to join
  • Discovering/defining the relationships between the types/schemas
  • Schema manipulation to avoid conflicts (e.g. renaming types/fields)
  • Declaring which schemas "own" a particular type, and detecting conflicts
  • Detecting breaking changes
  • Actually fetching the relevant data, and combining it to fulfil the GraphQL request
  • etc

Not wanting to cause an XKCD#927 situation…

XKCD 927

… but, it feels like it would be of benefit to the ecosystem at large if there were a shared specification that covers a few of these needs.


I propose we set up a working group encompassing people working on these problems and start some discussions around forming a common specification that covers a few of these needs.

I'm not suggesting that we aim to write a full specification for "The One True Way To Build A Big GraphQL Schema From A Number Of Smaller GraphQL Schemas" (TOTWTBABGSFANOSGS) ─ the different approaches listed above tend to solve slightly different problems and have different pros and cons for different situations. Instead, I propose a smaller specification that describes the common ground that everyone can build and innovate on top of. My hope is that this will help the entire ecosystem iterate more rapidly; and will also give GraphQL users more choice, enabling the best solutions for each given problem set to float to the surface more easily.

Initially, I think it would be great to get representatives from the various projects working in this space together to discuss what a spec might look like, and what it should contain. I propose the name "GraphQL Composite Schemas Working Group" to keep it as vendor neutral as possible.

If you're interested, comment below!

@yaacovCR
Copy link
Contributor

I would love to join the group.

@rivantsov
Copy link
Contributor

add me too, thanks!

@timsuchanek
Copy link
Member

Thanks for kicking this off @benjie! I'd love to join!

@saihaj
Copy link
Member

saihaj commented May 23, 2022

Yes I would love to join this!

@hayes
Copy link

hayes commented May 23, 2022

I'm interested in working on this

@mcollina
Copy link
Contributor

I’m in

@jensneuse
Copy link
Contributor

CEO of WunderGraph here. I really like the idea and would love to participate/contribute!
If this spec look right, we'd be more than happy to contribute a MIT licensed Gateway implementation in go/golang and add it to graphql-go-tools.

@StarpTech
Copy link
Contributor

Long overdue! Thanks for raising this. I'm looking forward!

@Urigo
Copy link
Contributor

Urigo commented May 24, 2022

So happy this is happening, I would love to join and support, thanks for leading it @benjie !

@xuorig
Copy link
Member

xuorig commented May 24, 2022

Count me in 👍

@grillorafael
Copy link
Contributor

Hey, I know I am not active here or anything but I've been using GraphQL in an enterprise context for about 2 years and relying on Federation / Stitch for a while. Have a special interest on Subscriptions and how people develop distributed schemas independently as well.

Any way I can join and be part of this working group?

@benjie
Copy link
Member Author

benjie commented May 24, 2022

Working groups tend to be open to all; this WG doesn't exist yet, but if/when it does I'll post here with details 👍

(Also thanks everyone for chiming in! I'm raising this at the next GraphQL Spec WG to see if we can make it an official WG 👍 )

@obi1kenobi
Copy link
Contributor

Great idea, would love to join! 🙌

@praveenweb
Copy link
Member

@benjie - Great initiative! Would love to participate and contribute to an open spec :)

@hwillson
Copy link
Member

Thanks for kick starting this @benjie! Apollo folks would love to attend as well.

@patrick91
Copy link
Member

I’m interested too :)

@ndejaco2
Copy link
Contributor

I am interested :)

@notrab
Copy link

notrab commented May 25, 2022

This is awesome. I'd love to be part of it, and help in any way I can to create some content on this once we have something 😄

@charlypoly
Copy link

Interested too, great initiative!

rfcs/CompositeSchemas.md Outdated Show resolved Hide resolved
@michaelstaib
Copy link
Member

I am in

rfcs/CompositeSchemas.md Outdated Show resolved Hide resolved
@benjie
Copy link
Member Author

benjie commented May 27, 2022

Thanks for your interest, everyone! I've added everyone to the list that has attended a GraphQL Spec Working Group somewhat recently (since we added GitHub usernames to the agendas); for those that I could not add like this (@hayes @jensneuse @grillorafael @obi1kenobi @patrick91 @ndejaco2 @notrab @charlypoly) once this PR gets merged, please follow up with your own PR to add yourself which will require you to agree to the various GraphQL agreements (see: https://github.com/graphql/graphql-wg#contributing-to-this-repo), then we can get you added!

@grillorafael
Copy link
Contributor

Thank you very much @benjie. I will do that as soon as this PR gets in.

@LunaticMuch
Copy link
Contributor

I am all in, it I can still apply :)

@buger
Copy link

buger commented May 27, 2022

Hi there! I'm Head of Engineering at Tyk.io, and we maintain our implementation of Federation algorithm for our GraphQL solution (and it is based a lot on https://github.com/wundergraph/graphql-go-tools).
We defo want to actively participle in this dicussions, and have expertise in this area.
Will raise CLA with our legal team, and try to add our company.

Thanks!

@doomsbuster
Copy link

I am interested!

@KoldBrewEd
Copy link

Count me in 🙌

@andimarek
Copy link
Contributor

@benjie
Another relevant solution in this space is Nadel: https://github.com/atlassian-labs/nadel

@benjie
Copy link
Member Author

benjie commented May 28, 2022

@andimarek Are you or someone from Nadel interested in joining?

@gmac
Copy link

gmac commented May 28, 2022

I’m game.

@okjulian
Copy link
Contributor

Awesome initiative, would love to contribute ❤️

@linux-jedi
Copy link
Contributor

Interested.

@chikit
Copy link
Contributor

chikit commented May 31, 2022

I'm an engineer on the GraphQL server at Meta. Would like to contribute.

@hellobudha
Copy link

Will be happy to contribute :)

@ataylormays-duetto
Copy link

I'm in! ✋

@bhupatikrish
Copy link

Thank you for doing this. I would like to contribute, please count me in.

@fotoetienne
Copy link
Contributor

a smaller specification that describes the common ground that everyone can build and innovate on top of

I think there would be a lot of value in this. In particular having a standard way to define object instance identity (such as @key in Apollo federation, or Node.id in Relay) would go a long way. Thanks for kicking this off @benjie !

@leebyron leebyron merged commit 32893b5 into main Jun 2, 2022
@leebyron leebyron deleted the composite-schemas-rfc branch June 2, 2022 18:21
@benjie
Copy link
Member Author

benjie commented Jun 2, 2022

Hi folks! This sub-WG has been ratified, so now is the time to open a pull request to add yourself to the list of interested parties (if you're not already there):

https://github.com/graphql/graphql-wg/edit/main/rfcs/CompositeSchemas.md

Next week is busy with the GraphQL conference, but after that I will look at the stated locations of all involved and try and pick an initial meeting time with the hopes as many of you as possible can make it. I will give at least a week's notice by posting in this thread.

Let's do this! 🙌 🚀

@benjie
Copy link
Member Author

benjie commented Jun 14, 2022

First meeting is now scheduled; please see this issue for details: graphql/composite-schemas-wg#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet