SDKs

FRAGMENT publishes SDKs in:

  • TypeScript
  • Go
  • Python
  • Ruby

The SDKs are open-source, implement authentication, and come with predefined GraphQL queries to help you get started.


Install the SDK for your language:

npm install --save @fragment-dev/node-client

Each SDK's README covers initialization, query generation, and usage:


To create an SDK in a language not listed above:

  1. Use the FRAGMENT CLI to generate GraphQL queries from your Schema:

    fragment get-schema \
      --output=schema.jsonc &&\
    fragment gen-graphql \
      --path=schema.jsonc \
      --output=queries.graphql

    Learn about the different options you can provide to gen-graphql in its reference section.

  2. Generate a type-safe SDK using a GraphQL codegen tool for your language. Provide the FRAGMENT API GraphQL schema as input.

  3. Implement authentication and error handling.