Skip to content

Latest commit

 

History

History

graphql-api

GraphQL API

This example demonstrates using the Fetch API to query a GraphQL endpoint. It also makes use of a GraphQL Code Generator which introspects the GraphQL API in order to generate types that can be used in our useLoaderData hooks for strong, generated types.

Setup

  • Setup the GRAPHQL_API environment variable
  • Run npm install
  • And start the example with npm run dev
  • Visit http://localhost:3000 in your browser.

Preview

Open this example on CodeSandbox:

Open in CodeSandbox

Example

This example makes use of Remix Resource Routes to fetch data from a sample GraphQL API in addition to exposing that data via a JSON API.

The relevant files:

Related Links