How to filter for a Craft CMS site in a GraphQL Mutation

Oscar de la Hera Gomez
Two flowers that represent Craft CMS and GraphQL side by side. Beneath them sits the text "GraphQL Mutation Site Filter."

A step by step guide on filtering a GraphQL mutation for a specific Craft CMS site.

The following tutorial walks you through how to filter a GraphQL mutation for a specific site in a multisite Craft CMS. It assumes that you have setup Craft CMS to work with the GraphQL, and have multiple sites setup.

If you wish to learn how to do the above, please consult the tutorials below.

Step One: Access the GraphiQL

A screenshot of the Craft CMS GraphiQL.

On your browser, access the Craft CMS GraphiQL by replacing YOUR_CRAFT_URL with the URL of your Craft CMS in the url below.

YOUR_CRAFT_URL/admin/graphiql

Step Two: Write the Mutation

A screenshot of a sample GraphQL mutation with a siteId parameter.

Please note that we used * in the screenshot above, which filters for all websites.

In the GraphiQL, write the mutation and add a siteId parameter with the handle of the website that you wish to filter for in that mutation. This implies that you need to identify for the Id of the website before passing it on to the mutation.

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
delasign logo

Book a Free Consultation.

An icon of an email.

Click here to email us.

Fill in the details below to book a free consultation or to let us know about something else. Whatever it is, we are here to help.

How can we help you ?

Contact Details