download

fun download(endpoint: String?, graph: String?, key: String?, graphVariant: String, registryUrl: String = "https://api.apollographql.com/graphql", schema: File, insecure: Boolean = false, headers: Map<String, String> = emptyMap())

Main entry point for downloading a schema either from introspection or from the Apollo Studio registry

One of endpoint (for introspection) or key (for registry) is required.

Parameters

endpoint

url of the GraphQL endpoint for introspection

graph

Apollo Studio users only The identifier of the Apollo graph used to download the schema.

key

Apollo Studio users only The Apollo API key. See https://www.apollographql.com/docs/studio/api-keys/ for more information on how to get your API key.

graphVariant

Apollo Studio users only The variant of the Apollo graph used to download the schema.

registryUrl

Apollo Studio users only The registry url of the registry instance used to download the schema. Defaults to "https://graphql.api.apollographql.com/api/graphql"

schema

the file where to store the schema. If the file extension is ".json" it will be stored in introspection format. Else it will use SDL. Prefer SDL if you can as it is more compact and carries more information.

insecure

if set to true, TLS/SSL certificates will not be checked when downloading.

headers

extra HTTP headers to send during introspection.