Log in to GraphQL EditorGet started
Docs
Introduction
Desktop app
External Tools
CLI

Use as a library | Zeus GraphQL TypeScript generator

Generate Code

This will be rarely used, but here you are! Use Zeus to generate Typescript and Javascript from GraphQL definitions

import { TreeToTS } from 'graphql-zeus';
import { Parser } from 'graphql-js-tree';

const schemaFileContents = `
type Query{
    hello: String!
}
schema{
    query: Query
}
`;

const typeScriptDefinition = TreeToTS.resolveTree(
  Parser.parse(schemaFileContents),
);

Dynamically Fetch Schema

This is useful when you need your schema fetched from your GraphQL endpoint in-code

import { Utils } from 'graphql-zeus';

Utils.getFromUrl('https://faker.graphqleditor.com/a-team/olympus/graphql').then(
  (schemaContent) => {
    // Use schema content here
  },
);