Skip to content
This repository was archived by the owner on Aug 18, 2023. It is now read-only.

Example: Integrating GraphiQL #176

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions graphiql/graphiql.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
showPrevButton: false
showNextButton: false
---

import GraphiQL from 'graphiql';
import { buildSchema } from 'graphql';
import { createGraphiQLFetcher } from '@graphiql/toolkit';
import '../node_modules/graphiql/graphiql.css';

import {
LandingLayout
} from '@redocly/developer-portal/ui';

import rawSchema from 'raw-loader!./schema.docs.graphql';

export default LandingLayout;

<GraphiQL
fetcher={
typeof window !== "undefined"
? createGraphiQLFetcher({
url: "http://swapi.apis.guru/graphql",
})
: function () {
/* nope */
}
}
editorTheme={"dracula"}
schema={buildSchema(rawSchema)}
/>
Loading