If you need to learn more about GraphQL itself, we recommend reading the GraphQL documentation, this page has information on how to use the Codex GraphQL API specifically.

Explorer

The GraphQL Explorer is a great way to learn about the Codex GraphQL API. It’s a tool that allows you to explore the API, run queries, and subscriptions, complete with with tabs, persistence, and history.

URLs

Codex provides a url for both queries & subscriptions (websockets) at the same resource.

Queries:

https://graph.codex.io/graphql

Websockets:

wss://graph.codex.io/graphql

Introspection

Codex does not support introspection queries against the API.

We do provide the introspection query response, as well as the most recent schema.

Communication

All queries and mutations are sent over HTTPS, using the POST method.

All websocket messages are sent over the wss protocol.

All messages are serialized as JSON.

Codegen

We recommend using GraphQL Code Generator to generate types and queries for your codebase, using the introspection schema provided here .

Below is an example of how you could integrate the code generator into your project.

codegen.ts
import type { CodegenConfig } from "@graphql-codegen/cli";

const config: CodegenConfig = {
  overwrite: true,
  schema: "https://graph.codex.io/schema/latest.graphql",
  documents: "src/**/*.ts",
  generates: {
    "src/gql/": {
      preset: "client",
    },
  },
};

export default config;