facebook / relay

Relay is a JavaScript framework for building data-driven React applications.
https://relay.dev
MIT License
18.24k stars 1.8k forks source link

Refactor resolver schema building #4700

Closed captbaritone closed 1 week ago

captbaritone commented 2 weeks ago

This PR restructures how we build schema from resolvers. The main goal is to enable client schema extension (CSE) SDL to reference types defined in Relay Resolvers. This requires that process resolvers in three stages:

  1. Extract SDL for type definitions
  2. Build a normalized schema for server + CSE + resolver types
  3. Add resolver fields to the normalized schema
  4. Validate the schema for resolver invariants

Apologies for the huge PR. Enabling this required moving a number of things around. If the idea seems good but nobody is confident that they can review, I can try to find bits to split out into smaller PRs/diffs.

facebook-github-bot commented 2 weeks ago

@captbaritone has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 1 week ago

@captbaritone merged this pull request in facebook/relay@a8062bfcc13a95188e27c89a4643c9e011696f54.