Searchโ€ฆ
GraphQL
Connect Jet Admin to any GraphQL API
GraphQL is an API design architecture that takes a different, more flexible approach. The key difference between GraphQL vs REST is that GraphQL doesnโ€™t deal with dedicated resources. Instead, everything is regarded as a graph implying itโ€™s connected.
What this means in practical terms is that you can tailor your request to match your exact requirements using the GraphQL query language. In addition to this, it lets you combine different entities into a single query.
A GraphQL query for a movie listings app might look something like this:
1
{
2
characters {
3
results {
4
id
5
name
6
status
7
species
8
type
9
gender
10
origin {
11
name
12
id
13
}
14
}
15
}
16
}
Copied!

1. Add your GraphQl resource

To connect GraphQL to JetAdmin, add a new resource from the settings and select GraphQL or select GraphQL as the resource when creating a new project.
โ€‹
Then, enter your API endpoint in the Base URL field. Base URL example:
1
https://rickandmortyapi.com/graphql
Copied!
Depending on your API authentication settings, you may need to enter URL parameters or headers, or set the method via the Authentication dropdown.

2. Make a request

You can display the results of GraphQL queries as with any other query in Jet Admin.
1
{
2
characters {
3
results {
4
id
5
name
6
status
7
species
8
type
9
gender
10
origin {
11
name
12
id
13
}
14
}
15
}
16
}
Copied!
More information about HTTP Requests in our documentation.
Last modified 1mo ago