graphql / graphql/graphql.github.io

`StarWarsSchema` type descriptions are `null` in Introspection docs

Offen
#1,496 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
889
Forks
1.5k
Ø Merge
4 T. 12 Std.
Gemergte PRs (30 T.)
21

Beschreibung

We're currently specifying descriptions in the `StarWarsSchema` using comments:

https://github.com/graphql/graphql.github.io/blob/51db38b9c3c32b7c0cb50640853ecace27aabc68/src/components/Marked/swapiSchema.tsx#L112-L113

...which is causing them to resolve as `null` when we run introspection queries, like in this example on the Introspection docs page:

> introspectionDocs1

The [newer versions of the spec](https://spec.graphql.org/October2021/#sec-Descriptions) outline that descriptions should use a `BlockString` like this:

```
"""
An autonomous mechanical character in the Star Wars universe
"""
type Droid implements Character {}
```

Here's with a `BlockString` description for `Droid` instead:

> introspectionDocs2

Looks like, alternatively, we could specify `commentDescriptions` in our invocation of `makeExecutableSchema`, but we might as well make our schema consistent with the current way of specifying descriptions in the spec.

I can open a PR for this change if it sounds good.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start in src/components/Marked/swapiSchema.tsx, especially the description comments around lines 112–113, and compare them with the GraphQL specification's BlockString example. Check the Introspection docs page to reproduce the null descriptions. Done means the StarWarsSchema descriptions appear in introspection results instead of null.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
documentation
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.