Fetching a Single Object
If you look at the reference documentation you can see on the top level there is a node
query. This query can fetch any object which implements the Node
interface, which is almost every object in our API. The Node
interface defines just one field, the id
field, so you have to use an Inline Fragment what to do for specific types. Below is some simple examples of how this works.
In this example we'll use the Example Map Plan everyone sees when they first log into DroneDeploy. This has the ID of MapPlan:5a3d7badf014ce3db3c22391
. You can see the IDs of your own plans by listing your organizations plans, shown here.
The simplest example of using the node
query is this.
Since the node
query returns a Node
object, the only field available is id
. This isn't very useful, what you want is the fields specific to the MapPlan
type. For this you use an Inline Fragment: You can try this out here.
Which returns the data:
When you specify the type it allows you to query the fields for that specific type.
Last updated