apyhub
DEVELOPER TOOLS · FILE CONVERSION

Convert JSON to GraphQL Schema API

Hosted on ApyHub

What it does

Convert JSON into GraphQL SDL with the JSON to GraphQL SDL service. Send a non-empty JSON object, or point it at a public JSON URL or uploaded JSON file, and get GraphQL schema definition language back as inline text, a downloadable .graphql file, or a pre-signed S3 URL.

Use the raw-body endpoints when you already have JSON in your request payload. Use the file-upload endpoints when your JSON lives in a file, and the URL endpoints when the source is hosted elsewhere. The file-based routes require a JSON file with MIME type application/json, while the URL-based routes accept a public URL that serves JSON-compatible content or a .json path.

The response format depends on the route you choose: inline endpoints return the generated SDL as a string, downloadable-file endpoints return binary GraphQL SDL, and S3-url endpoints return an object with a data field containing a pre-signed URI.

This is useful when you need to turn API payloads, sample responses, or data exports into a GraphQL schema draft for documentation, prototyping, or schema-first development.

▣ ENDPOINT 01 / 09
POST
Convert uploaded JSON file to GraphQL SDL (S3 signed URL)
http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-file-graphql-url
QUICKSTARTGUIDE

Quickstart

Upload a JSON file to convert it into GraphQL SDL.

curl -X POST "http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-file-graphql-url" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.json" \
  -F "output=my-schema"

What you'll get back

Returns a JSON object with a data string field containing a pre-signed S3 URL to the converted file.

{
  "data": "https://example-bucket.s3.amazonaws.com/converted-file"
}
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
JSON file to convert. Must have MIME type application/json and contain a non-empty JSON object.

About this endpoint

What it does

Converts an uploaded JSON file into GraphQL SDL and returns a pre-signed S3 URL for the converted file. The request uploads a binary JSON file, and the response contains the generated file URL as a string.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput name. Default: sample-output.

Request Body

ParameterTypeMandatoryDescription
fileStringYesJSON file to convert. Must be a binary upload with MIME type application/json and contain a non-empty JSON object.

Response

Returns a JSON object with a data string field containing a URI. The data value is the pre-signed S3 URL to the converted file.

ParameterTypeMandatoryDescription
dataStringYesPre-signed S3 URL to the converted file.

Query parameters

Name
Type
Description
outputOPTIONAL
string
DEFAULT sample-output

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 09
POST
Convert raw JSON body to GraphQL SDL (inline response)
http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-raw-graphql-raw
QUICKSTARTGUIDE

Quickstart

Convert a JSON object to GraphQL SDL by sending the object in the request body.

curl -X POST "http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-raw-graphql-raw" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"user":{"id":1,"name":"Ada Lovelace"}}'

What you'll get back

Returns a JSON string containing the generated GraphQL SDL.

"type User {\n  id: Int\n  name: String\n}\n\ntype Query {\n  user: User\n}"
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Converts a raw JSON object in the request body into GraphQL SDL and returns the SDL as a string.

Request Body

ParameterTypeMandatoryDescription
bodyObjectYesA non-empty JSON object (not an array) to convert to GraphQL SDL. Must contain at least 1 property; additional properties are allowed.

Response

Returns a JSON string containing the generated GraphQL SDL.

ParameterTypeMandatoryDescription
responseStringYesThe GraphQL SDL generated from the input JSON object.

Body

Name
Type
Description
bodyREQUIRED
object
A non-empty JSON object (not an array) to convert to GraphQL SDL.
▣ ENDPOINT 03 / 09
POST
Convert raw JSON body to GraphQL SDL (S3 signed URL)
http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-raw-graphql-url
QUICKSTARTGUIDE

Quickstart

Convert a JSON object to GraphQL SDL and return a pre-signed download URL.

curl -X POST "http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-raw-graphql-url?output=my-schema" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"my-schema","version":1}'

What you'll get back

Returns a JSON object with a data string — a pre-signed S3 URI for the converted file.

{
  "data": "https://s3.amazonaws.com/..."
}
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Converts a raw JSON object sent in the request body into GraphQL SDL, then returns a pre-signed S3 URL where the converted file can be downloaded.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput name. Default: sample-output.

Request Body

ParameterTypeMandatoryDescription
bodyObjectYesA non-empty JSON object (not an array) to convert to GraphQL SDL. Min properties: 1. Additional properties are allowed.

Response

Returns a JSON object with a data string field containing a URI. The data value is a pre-signed S3 URL to the converted file.

ParameterTypeMandatoryDescription
dataStringYesPre-signed S3 URL to the converted file.

Query parameters

Name
Type
Description
outputOPTIONAL
string
DEFAULT sample-output

Body

Name
Type
Description
bodyREQUIRED
object
A non-empty JSON object (not an array) to convert to GraphQL SDL.
▣ ENDPOINT 04 / 09
POST
Convert JSON from URL to GraphQL SDL (downloadable file)
http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-url-graphql-file
QUICKSTARTGUIDE

Quickstart

Convert a public JSON file URL into a downloadable GraphQL SDL file.

curl -X POST "http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-url-graphql-file" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.json"}'

What you'll get back

Returns a downloadable GraphQL SDL file as binary data (.graphql).

(binary file)
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Public URL pointing to a JSON file. The response must have a content-type that includes `application/json`, `text/plain`, `application/octet-stream`, or `binary/octet-stream`; or a `content-disposition` header / URL path that includes `.json`.

About this endpoint

What it does

Converts the JSON document available at a public URL into a GraphQL SDL file for download. The request sends the source JSON URL in the body, and the response is a downloadable .graphql file.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput file name. Default: sample-output.

Request Body

ParameterTypeMandatoryDescription
urlStringYesPublic URL pointing to a JSON file. The response must have a content-type that includes application/json, text/plain, application/octet-stream, or binary/octet-stream; or a content-disposition header / URL path that includes .json.

Response

Returns a binary downloadable file containing GraphQL SDL (.graphql). The success response is a single binary payload, not a JSON object, with the file content described as a downloadable GraphQL SDL file.

Query parameters

Name
Type
Description
outputOPTIONAL
string
DEFAULT sample-output

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 05 / 09
POST
Convert raw JSON body to GraphQL SDL (downloadable file)
http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-raw-graphql-file
QUICKSTARTGUIDE

Quickstart

Convert a JSON object into a GraphQL SDL file.

curl -X POST "http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-raw-graphql-file" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"sampleField":"sample-value"}'

What you'll get back

Returns a downloadable GraphQL SDL file (.graphql) as binary content.

(binary file)
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Converts a raw JSON object in the request body into a downloadable GraphQL SDL file. The response is a binary .graphql file containing the generated SDL.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput name for the generated file. Default: sample-output.

Request Body

ParameterTypeMandatoryDescription
bodyObjectYesA non-empty JSON object to convert to GraphQL SDL. Additional properties are allowed.

Response

Returns a binary downloadable file with GraphQL SDL content in .graphql format.

ParameterTypeMandatoryDescription
fileStringYesBinary GraphQL SDL file (.graphql).

Query parameters

Name
Type
Description
outputOPTIONAL
string
DEFAULT sample-output

Body

Name
Type
Description
bodyREQUIRED
object
A non-empty JSON object (not an array) to convert to GraphQL SDL.
▣ ENDPOINT 06 / 09
POST
Convert JSON from URL to GraphQL SDL (inline response)
http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-url-graphql-raw
QUICKSTARTGUIDE

Quickstart

Convert a JSON file at a public URL into GraphQL SDL with a single request.

curl -X POST "http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-url-graphql-raw" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.json"}'

What you'll get back

Returns a JSON string containing the generated GraphQL SDL.

"type Query {\n  ...\n}"
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Public URL pointing to a JSON file. The response must have a content-type that includes `application/json`, `text/plain`, `application/octet-stream`, or `binary/octet-stream`; or a `content-disposition` header / URL path that includes `.json`.

About this endpoint

What it does

Converts the JSON document available at a public URL into GraphQL SDL and returns the SDL as a raw string in the response. The request body takes a single url field pointing to the source JSON file.

Request Body

ParameterTypeMandatoryDescription
urlStringYesPublic URL pointing to a JSON file. Must be a valid URI. The response must have a content-type that includes application/json, text/plain, application/octet-stream, or binary/octet-stream; or a content-disposition header / URL path that includes .json.

Response

Returns a raw string containing the generated GraphQL SDL. The success response is a plain string, not a JSON object wrapper.

ParameterTypeMandatoryDescription
valueStringYesThe generated GraphQL SDL.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 07 / 09
POST
Convert JSON from URL to GraphQL SDL (S3 signed URL)
http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-url-graphql-url
QUICKSTARTGUIDE

Quickstart

Convert a JSON file at a public URL into GraphQL SDL by sending the file URL in the request body.

curl -X POST "http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-url-graphql-url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.json"}'

What you'll get back

Returns a JSON object with a data string field containing a pre-signed S3 URL to the converted file.

{
  "data": "https://..."
}
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Public URL pointing to a JSON file. The response must have a content-type that includes `application/json`, `text/plain`, `application/octet-stream`, or `binary/octet-stream`; or a `content-disposition` header / URL path that includes `.json`.

About this endpoint

What it does

Converts the JSON file available at the provided URL into GraphQL SDL, then returns a JSON object containing a pre-signed S3 URL for the converted file.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput filename or identifier. Default: sample-output.

Request Body

ParameterTypeMandatoryDescription
urlStringYesPublic URL pointing to a JSON file. The response must have a content-type that includes application/json, text/plain, application/octet-stream, or binary/octet-stream; or a content-disposition header / URL path that includes .json.

Response

Returns a JSON object with a data string field. The data value is a pre-signed S3 URL to the converted file.

ParameterTypeMandatoryDescription
dataStringYesPre-signed S3 URL to the converted file.

Query parameters

Name
Type
Description
outputOPTIONAL
string
DEFAULT sample-output

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 08 / 09
POST
Convert uploaded JSON file to GraphQL SDL (inline response)
http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-file-graphql-raw
QUICKSTARTGUIDE

Quickstart

Upload a JSON file to convert it into GraphQL SDL.

curl -X POST "http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-file-graphql-raw" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.json"

What you'll get back

Returns a plain string containing the generated GraphQL SDL.

type Query {
  ...
}
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
JSON file to convert. Must have MIME type application/json and contain a non-empty JSON object.

About this endpoint

What it does

Uploads a JSON file and returns GraphQL SDL as the response. The input must be a JSON file with MIME type application/json containing a non-empty JSON object.

Request Body

ParameterTypeMandatoryDescription
fileStringYesJSON file to convert. Must have MIME type application/json and contain a non-empty JSON object.

Response

Returns a plain string containing the generated GraphQL SDL. The response body is a String.

ParameterTypeMandatoryDescription
valueStringYesThe generated GraphQL SDL.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 09 / 09
POST
Convert uploaded JSON file to GraphQL SDL (downloadable file)
http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-file-graphql-file
QUICKSTARTGUIDE

Quickstart

Upload a JSON file to convert it into a GraphQL SDL file.

curl -X POST "http://localhost:8080/apyhub/convert-json-to-graphql-sdl/json-file-graphql-file?output=my-schema" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/input.json"

What you'll get back

Returns a downloadable GraphQL SDL file (.graphql) as binary content.

(binary file)
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
JSON file to convert. Must have MIME type application/json and contain a non-empty JSON object.

About this endpoint

What it does

Converts an uploaded JSON file into a downloadable GraphQL SDL file. The request uploads a JSON file, and the response is a binary .graphql file.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput name. Default: sample-output.

Request Body

ParameterTypeMandatoryDescription
fileStringYesJSON file to convert. Must use MIME type application/json and contain a non-empty JSON object.

Response

Returns a binary file containing GraphQL SDL (.graphql). The response is a downloadable file, not a JSON object.

ParameterTypeMandatoryDescription
binaryStringYesDownloadable GraphQL SDL (.graphql) file.

Query parameters

Name
Type
Description
outputOPTIONAL
string
DEFAULT sample-output

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.