Recipes
A list of common use case to handle with GraphQL API.
Create a live contribution
To create a live contribution, you have to use CreateLiveContribution mutation.
You have to know the live ID, we use "bG9jYWw6TGl2ZTox" as live ID in this example.
Copy/paste this mutation to Sirius GraphQL Playground and execute it.
mutation CreateLiveContribution($liveId: "bG9jYWw6TGl2ZTox"$text: "I Will Find You And I Will Kill You",$authorName: "Chris Hardwick",$authorEmail: "c.hardwick@gmail.com") {createLiveContribution(input: {liveId: $liveIdtext: $textauthorName: $authorNameauthorEmail: $authorEmail}) {id}}
Note that we choose to return the id
because we have to return at least one field in a GraphQL type.
Query layouts "id" and "names"
To list all layouts, uses articleLayouts query.
The query articleLayouts
returns a ArticleLayoutConnection which contains nodes
.
Copy/paste this query to Sirius GraphQL Playground and execute it.
query Layouts {articleLayouts {nodes {idname}}}
The returned data should have the following shape:
{"data": {"articleLayouts": {"nodes": [{"id": "bG9jYWw6TGF5b3V0Ojk=","name": "Sirius Live"},{"id": "bG9jYWw6TGF5b3V0OjE=","name": "Article"}]}}}
Import an article
This GitHub project is a step-by-step tutorial to help you import an Article in Sirius using GraphQL API. It is written in JavaScript but the method is the same for every language.
Edit this page on GitHub