Insites Docs Instance APIGraphQLCreating a GraphQL Query

Creating a GraphQL Query

Last updated on April 09, 2026.

There are two ways to create GraphQL queries on your Instance. Developers typically write .graphql files in their local project and deploy them using the Insites CLI tool. You can also create queries directly in the admin, which is useful for quick additions or testing without a full deployment cycle.

Creating a Query in the Admin

  1. Navigate to API from the main menu.
  2. Select GraphQL.
  3. Select CREATE GRAPHQL QUERY.
  4. Fill out the form (see the field reference below).
  5. Select CREATE GRAPHQL to save.

Field Reference

Input Label Type Required Description
GraphQL Name Input Field Yes A descriptive display name for your query. This is what you see in the admin list view.
Name Input Field No The system identifier, derived from the File Path. This is the name used when calling the query from Liquid templates.
File Path Input Field Yes The file location for your .graphql file. Use the folder picker to select the module path.
Body Code Editor Yes The GraphQL query or mutation definition. Write your query using standard GraphQL syntax.

The Name field is generated from the File Path. This is the identifier you reference when calling the query from your Liquid templates.

Creating Queries via the CLI Tool

For most development work, you will create .graphql files in your local project directory:

  • app/graphql/ for custom application queries
  • Inside your module directory for module-specific queries

Deploy your queries using the CLI tool:

  • During development: insites-cli sync watches for file changes and uploads them immediately.
  • For production: insites-cli deploy packages and deploys your full codebase.
insites-cli sync staging

Once deployed, your queries appear in the GraphQL section of the admin and can be called from Liquid templates.

Queries created via the CLI tool and queries created in the admin both work the same way. The CLI tool is the recommended workflow for development, while the admin is convenient for quick changes.

Have a suggestion for this page?

Didn't quite find what you are looking for or have feedback on how we can make the content better then we would love to hear from you. Please provide us feedback and we will get back to you shortly.