GraphiQL Explorer Quick Start
In this demo, you’re going to visit the GraphiQL Explorer that works with Aligni Demo environment and execute one GraphQL query and one mutation.
Step 1 – Visit the GraphiQL Explorer built into Aligni
- Visit https://demo.aligni.org/api/v3/graphiql
- Click on the “Show GraphiQL Explorer” icon in the menu on the left side of the screen (it looks like a folder with “+”).
- You should see an Explorer panel that lets you build queries quickly by selecting fields that you need.
Step 2 – Run a query
- Click on the “parts” query.
- Click to expand the “nodes” section.
- Select
id
andmanufacturerPn
. - Run the query by clicking on the play button in the query editor panel.
- The results panel will show 10 parts with
id
andmanufacturerPn
attributes as requested:
Step 3 – Expand the query
- Now, add revisions to the query by expanding
revisions
and thennodes
and selectingid
,revisionName
andstatus
. - Run the query again and you will see the list of revisions for each part:
Step 4 – Set up a mutation
Mutations are how data is added or updated in GraphQL terminology. Let’s run a mutation that will create a new part revision for “XC3S400-4PQ208C”.
- Click on the “+” link in the top right part of the screen to “Add tab“.
- Scroll to the bottom of the Explorer area that has the list of mutations, until you see the “Add new…” control.
- Select “Mutation” in the select box and click on the “+” next to the select box.
- You will then see the list of queries in the Explorer:
Step 5 – Specify which data to change
- Select “partRevisionCreate” mutation from the list.
- Click on “revisionName” and enter the value “
B
“. - Click on “sourcePartRevisionId” and enter the value “
itr_0194YWYH2GW5KS2HECGPX74MJR
“. - Then select “errors” and “partRevision“.
- Under “partRevision“, select “id” and “revisionName“.
Step 6 – Execute the mutation
- Execute the query by clicking on the play button:
- If you then execute the query defined in the previous section, you will see that the part “XC3S400-4PQ208C” has a new revision: