Skip to content

GraphQL

Table of contents
Experimental
View source
Table of contents

Sometimes you need a more specific or complex dataset than our standard RESTful APIs can provide. For this reason, we have also provided a GraphQL API.

If you are unfamiliar with GraphQL, click here to learn more.

Usage

query

Allows you to perform query operations on the Graph.

Parameters

PropertyTypeRequiredExample
queryStringquery whoami($id: String!) { user(_id: $id) { display_name } }
variablesObject{ id: "92ac7274-9369-11ea-9521-01002da17977" }
headersObject{ Accept-Language: "es" }

Usage

const myName = await Xedi.GraphQL.query(
`query whoami($id: String!) {
me: user(_id: $id) {
display_name
}
}`,
{
id: "92ac7274-9369-11ea-9521-01002da17977"
},
{
"Accept-Language": "es"
}
);

Response

{
"me": {
"display_name": "Anthony Stark"
}
}

If you are wanting to use our GraphQL API, we recommend using GraphiQL or Insomia as great starting points. Our API supports introspection which means it can provide these clients with up-to-date documentation.

Edit this page on GitHub
2 contributorssamb20Smudge3806
Last edited by samb20 on September 4, 2020