ardatan / ardatan/graphql-mesh
Use Mesh to enable global object identification support
- Dominant language
- TypeScript
- Stars
- 3.5k
- Forks
- 363
- Avg merge
- 6h 10m
- Merged PRs (30d)
- 19
Description
Being able to leverage [global object identification](https://graphql.org/learn/global-object-identification/) can be extremely helpful in reducing complexity and improve DRY on the client. the usefulness increases with multi source setups.
Implementing this is not always possible however:
- Limited control of downstream sources (especially when they are third party) prevents ensuring global uniqueness of keys
- Even with full control of downstream sources it might not always be feasible to rebuild them to support global unique ids
- Even with only a single source, it might not even support unique ids across types (auto increment int ids etc.)
**Describe the solution you'd like**
- Extend schema to comply with the [global object identification](https://graphql.org/learn/global-object-identification/) spec
- Build resolver that ensures that returned ids are unique across sources as well as within a sources
- one option would be to include the type name (post transforms) as a prefix for any id the downstream source provides
- since types returned by mesh are unique this would ensure unique ids across data sources
- Extend configuration to support configuration of
- which types are supported
- while the default should be all
- a source might not support retrieving specific objects for a certain types
- ability to specify the query to be used to retrieve a single object
- this should support default on root and on source level
- as well as specify it on a per type basis
- I created more generic feature request to allow argument standardization #2156
- if this would exist it would ensure uniformity of querying single objects across apis already
- hence remove the necessity for additional configuration as part of the global object identification transform
- assuming the argument standardization transform would always need to be used in tandem the global object identification
Contributor guide
No contributing guide indexed for this repository
Research direction
No implementation files, tests, or entry points are named. Start by reviewing the GraphQL global object identification specification and related argument-standardization issue #2156, then locate the Mesh transform and its tests. Done means supported types, globally unique IDs, and configurable single-object retrieval are defined and covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100