Using Legalesign GraphQL Explorer
Open the Legalesign GraphQL Explorer
Go to Legalesign GraphQL Explorer and log in with your credentials, you should be presented with the following screen.
If you don't yet have any legalesign.com credentials, go to the free trial page and sign up here
Create a Query
In order to get you going as quickly as possible, let's execute a query straight away and make sure that everything is working.
Past the following into the main query window.
query MyFirstQuery {
user {
id
name
}
}
By default, if you call the user object the information returned is your own. So this query should return
your unique id
and name
.
Execute the query by clicking the play button in the top toolbar.
Understanding Results in GraphQL Explorer
{
"data": {
"user": {
"id": "dXNyZTE2NBB1NWQtNWVjXS00NzIzL3G3NDI5ODEtZmFhOGFjYzdlMGRh",
"name": "Bob Mortimer",
"firstName": "Bob",
"lastName": "Mortimer"
}
}
}
As you can see an object with a data
property has been returned. Inside that the data
object is another called user
- this is
because we asked for a single User
object to be return.
Note that User is a special case - if you don't provide an id
for the object you want, it assumes that you want to use your own id. This
is very common as the first hand-shaking query of an application or integration. With other object types you will always need to pass the
specific id
of the object you are interested in, such as;
query GetAGroup {
group(id: 'zSJy2jhsdDF') {
id
name
}
}
How to Find Out More
In the top right corner you should see a link marked < Docs
(assuming it isn't already open for you). Click on it to open the documentation pane.
This is one of the most important features of GraphQL Explorer, it allows you to find out about which object types you can retrieve, and what fields
each of those types has on it.
Let's suppose that we wanted to expand our example query. What other fields are there?
In the Search Schema
box let's type User
. The top result should be the User
graphql type that we're looking for. Click on it and you should
be presented with the list of fields that the User
object makes available to you, and the description for each field in case you are unsure
of what it means.