graphprotocol / graphprotocol/graph-node

[Feature] Expose utility to generate "full" API schema from entities GQL schema

Aperta
#4,710 9 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement
Lingua principale
Rust
Stelle
3.2k
Fork
1.1k
Merge medio
4g 1h
PR unite (30g)
1

Descrizione

Description

As it is, the only way to get the "true" GQL API schema is to deploy a subgraph and perform an introspection query. This is very painful for tooling and codegen purposes. It would be very nice to be able to generate the full schema locally from the "entities" schema.

I noticed this is relatively easy to isolate, as it is being done here: https://github.com/graphprotocol/graph-node/blob/252e9129588b0b022bcaf50bbe365287db18241b/graphql/examples/schema.rs

I'm actually in the process of creating a docker image that does exactly that. I basically cloned this repo, added a build target for that script and created a dockerfile that runs it, but it is not a very elegant solution. I'll still share it here once it's up in case someone else needs it.

I know this is more of a feature request for the CLI, but since the relevant code resides in this repo, and the CLI repo doesn't have a "Feature Request" template, I thought I'd open the issue here.

Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.

No response

Some information to help us out
  • Tick this box if you plan on implementing this feature yourself.
  • I have searched the issue tracker to make sure this issue is not a duplicate.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da graphql/examples/schema.rs, che l’issue identifica come il percorso esistente per la generazione dello schema, e traccia come deriva uno schema dallo schema Entities. Definisci il punto di ingresso dell’utility esposta e verifica che produca localmente lo schema completo dell’API GQL senza distribuire un subgraph né usare l’introspection.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
graphql, rust
Ambito
api, tooling
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.