Polaris API example queries
With GraphQL, there is only one endpoint, so you’ll need to write a query to specify what data you want to fetch or modify.
To use the Playground, you must be logged in to your instance, and your endpoint path must match the swimlane where your instance is hosted.
Note: When you make queries from the GraphQL Playground, you’re making changes to your live instance. If you want to try the Playground without impacting live data, contact Replicon Support to have a sandbox instance created.
Note: You can include an operation name in each query, to aid in error handling, though it’s not required.
Getting user details
Query | Result |
---|---|
query { users {emailAddress,id,loginName} } | { "data": { "users": [ { "emailAddress": "[email protected]", "id": "urn:replicon-tenant:0020120fa8e3470b9faa0c378f9d3425:user:4", "loginName": "randerson" }, { "emailAddress": [email protected], "id": "urn:replicon-tenant:0020120fa8e3470b9faa0c378f9d3425:user:545", "loginName": "mwolf" } ] } } |
Field name | Example |
---|---|
{ user(id: "urn:replicon-tenant:0020120fa8e3470b9faa0c378f9d3425:user:515") { firstName } } | { "data": { "user": { "firstName": "Paula" } } } |
Adding a project
Query | Result |
---|---|
mutation { addProject(projectInput: {name: "NewProject"}) { project { name } }} | { "data": { "addProject": { "project": { "name": "NewProject" } } } } |
Assigning an owner to a task
Query | Result |
---|---|
mutation { updateTask(input: { taskUri: "urn:replicon-tenant:0020120fa8e3470b9faa0c378f9d3425:task:36" assignedUserUri: "urn:replicon-tenant:0020120fa8e3470b9faa0c378f9d3425:user:522"}) { task { assignedUserUri } }} | { "data": { "updateTask": { "task": { "assignedUserUri": "urn:replicon-tenant:0020120fa8e3470b9faa0c378f9d3425:user:522" } } } } |