remove: graphiql form subject

This commit is contained in:
lee 2021-06-22 09:07:21 +01:00
parent b0e4f751c0
commit 03dd595b18
2 changed files with 2 additions and 38 deletions

View File

@ -48,7 +48,7 @@ for example: [github-pages](https://pages.github.com/), [netlify](https://www.ne
### Usage
> To test your queries you can access the GraphQL IDE on _https://((DOMAIN))/public/subjects/graphql/_ or create your own [**GraphiQL Docs**](https://github.com/graphql/graphiql). This will give you a bigger picture of the tables, attributes and all the types of queries that you can do.
> To test your queries you can access the GraphQL IDE on _https://((DOMAIN))/graphql/_ or create your own [**GraphiQL Docs**](https://github.com/graphql/graphiql). This will give you a bigger picture of the tables, attributes and all the types of queries that you can do.
Here are the list of tables that you are allowed to query (it will be only provided the columns present on the tables):
@ -152,7 +152,7 @@ You can see the result using `curl`:
- `curl "https://((DOMAIN))/api/graphql-engine/v1/graphql" --data '{"query":"{user(where:{id:{_eq:6}}){id login}}"}'`
In graphQL the usage of arguments can be specified in the schema of the API. Like said above you can visit the _docs_ for the graphQL endpoint, _https://((DOMAIN))/public/subjects/grapqhl_
In graphQL the usage of arguments can be specified in the schema of the API. Like said above you can visit the _docs_ for the graphQL endpoint, _https://((DOMAIN))/grapqhl_
Example of nesting, using the result and user table :

View File

@ -1,36 +0,0 @@
<html>
<head>
<title>GraphiQL</title>
<link href="https://unpkg.com/graphiql/graphiql.min.css" rel="stylesheet" />
</head>
<body style="margin: 0;">
<div id="graphiql" style="height: 100vh;"></div>
<script
crossorigin
src="https://unpkg.com/react/umd/react.production.min.js"
></script>
<script
crossorigin
src="https://unpkg.com/react-dom/umd/react-dom.production.min.js"
></script>
<script
crossorigin
src="https://unpkg.com/graphiql/graphiql.min.js"
></script>
<script>
const graphQLFetcher = graphQLParams =>
fetch(`https://${location.hostname}/api/graphql-engine/v1/graphql`, {
method: 'post',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(graphQLParams),
})
.then(response => response.json().catch(() => response.text()))
ReactDOM.render(
React.createElement(GraphiQL, { fetcher: graphQLFetcher }),
document.getElementById('graphiql'),
)
</script>
</body>
</html>