-
Notifications
You must be signed in to change notification settings - Fork 130
Added GraphQL #1461
Added GraphQL #1461
Changes from all commits
925130d
1a7a10e
ba02e11
3035b25
71fbe51
3de2646
55af347
3c40c95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
description: How to access the Pantheon API using GraphQL | ||
<!--- END of page meta data --> | ||
|
||
# GraphQL over HTTP | ||
|
||
GraphQL can reduce the overhead needed for common queries. For example, instead of querying each receipt in a | ||
block, GraphQL can obtain the same result with a single query for the entire block. | ||
|
||
## GraphQL Requests with Curl | ||
|
||
[Pantheon JSON-RPC API methods](../Reference/Pantheon-API-Methods.md) with an equivalent [GraphQL](../Pantheon-API/GraphQL.md) | ||
query include a GraphQL request and result in the method example. | ||
|
||
!!! example | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we just explaining in one line what this example request does : "Returns an result with data about the synchronization status" as it's described in the API ref. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
The following [`syncing`](../Reference/Pantheon-API-Methods.md#eth_syncing) request returns data about the synchronization status. | ||
```bash | ||
curl -X POST -H "Content-Type: application/json" --data '{ "query": "{syncing{startingBlock currentBlock highestBlock}}"}' http://localhost:8547/graphql | ||
``` | ||
|
||
## GraphQL Requests with GraphiQL App | ||
|
||
The third-party tool [GraphiQL](https://github.com/skevy/graphiql-app) provides a tabbed interface for editing and testing GraphQL | ||
queries and mutations. GraphiQL also provides access the Pantheon GraphQL schema from within the app. | ||
|
||
 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The screenshot should display the same query as in cURL request for consistency. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good explanation of the advantages but does not match the title that makes me expect specific things about making GraphQL requests over HTTP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NicolasMassart - Do you mean there's nothing about why you'd use GraphQL over HTTP specifically? HTTP is the only option for GraphQL. I thought about removing the transport method from the titles but have just recently specifically added it to make it it clearer the RPC Sub/Pub API is over WebSockets to make it more findable.