Docs
Launch GraphOS Studio

Downloading a schema


requires a file as input to its code generation process. You can provide your schema either in JSON format (most commonly the result of an ) or in GraphQL ().

Conventionally, JSON files have the .json extension and files use the .graphqls extension.

There are a few ways to download a :

1. Apollo Studio

Apollo Studio is a cloud platform that helps you build, validate, and secure your organization's .

In the view of the Schema tab of Apollo Studio there is a drop-down menu where you can download the linked schema in SDL or JSON format.

Below is a screenshot showing the

in an Apollo Studio
public example
. On the right-hand side you can see the drop-down allowing downloads of both formats.

Where to download a schema from Apollo Studio

Please see the

for further details on how to use Apollo Studio.

2. Codegen CLI

The Codegen CLI provides a convenient command-line tool for fetching a and writing it to a file.

See the documentation on the

command for details on how to use it.

The codegen CLI also supports fetching a as an initial step in the code generation process. This automates fetching the schema and ensures you are always using the most up-to-date schema.

See the documentation on the

command for details on how to use it.

The Apollo schema registry and are both supported as methods for downloading.

Apollo schema registry

The Apollo schema registry serves as a central hub for managing your . At its core, the schema registry is a version control system for schemas. It stores a schema's change history, tracking the types and that were added, modified, and removed. In order to fetch a schema from the schema registry using the codegen CLI you will need credentials detailed in

.

GraphQL introspection

enables you to a for information about the underlying schema. This includes data like types, , queries, , and even the field-level descriptions.

See the spec for full details on the

feature.

Note: Many production servers disable for security reasons. If your introspection is failing check that it is not disabled.

Previous
Configuration
Next
Running Code Generation in Swift Code
Edit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy

Company