Questions tagged [graphql]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

GraphQL mutation query max length for text field

I'm trying to insert a quite long text via GraphQL into a text field. I get the following error message when doing so: 'Bio Helper should contain at most 65,535 characters.' When I copy and paste ...
obs's user avatar
  • 509
1 vote
1 answer
52 views

Using a GraphQL mutation query to create matrix blocks

I'm trying to write a GraphQL query which creates matrix blocks. The information in the docs as well as this question didn't help to get it working. This is what the field settings look like: This is ...
obs's user avatar
  • 509
1 vote
1 answer
44 views

GraphQL - Behaviours

I have an headless site that is using GraphQL and we have one query that need to do some calculation before returning the results. I was planing to create a behaviours in Craft with a property that ...
Robin Gauthier's user avatar
0 votes
0 answers
22 views

How can I query for entries of a given type which point to a particular other entry by URI on a particular field?

I can run this query: mySectionEntries(myEntryRelationField: "target-id") { ... } This gets entries from section mySection which point to an entry with ID target-id on the entries ...
tremby's user avatar
  • 165
0 votes
0 answers
87 views

Craft cms[4.x]: Frontend Site broke after performing a feed with feed me

On our last data migration from wordpress i import through feed me all the data but the postDates. 31-08-2023 11:12 I imported a csv file in feed me with all the posts content including the postDates ...
Adam Fernandez's user avatar
1 vote
2 answers
93 views

GraphQL queries for srcset

I am trying to fetch srcset with GraphQL from Craft4 but I don't really understand the syntax. In my twig Templates I use image.getSrcset(['1x','2x'],'myTransformHandle') and I'm trying to translate ...
thomas's user avatar
  • 131
1 vote
1 answer
369 views

CraftCMS headless / Nuxt - not getting live preview to work

Over the past few weeks I've been working on a headless CraftCMS integration with Nuxt for the frontend. I use Apollo and GraphQL to fetch the data from the CMS. Almost there now, but there's one ...
Maik_BEELDR's user avatar
0 votes
0 answers
53 views

Import Image on Matrixblock via GraphQL Mutation

I'm trying to create an Entry via a GraphQL mutation. The whole Entry consists of one Matrix(handle: siteimportmatrix ) with one Block(handle: importblock ) which has 4 fields one of the fields is an ...
Maximilian Enzinger's user avatar
0 votes
0 answers
42 views

ETIMEDOUT on graphql requests

I'm using craft's graphql to generate a static site with a nuxt frontend. The generator manages to generate about 40 routes, then it returns Error: Network error: request to https://geo-api....
Jane's user avatar
  • 11
1 vote
1 answer
95 views

Get custom fields data on GraphQL

I have several custom fields on craftcms (cp/settings/fields), and some of them are dropdowns. I'm trying to get this custom fields data (for example the dropdown options) on graphql, because we are ...
Nairo Granados's user avatar
1 vote
1 answer
3k views

With GraphQL why am I getting the error "Cannot query field \"save_personEvents_default_Entry\" on type \"Mutation\". "?

In Craft 3 I am trying to use GraphQL to mutate an existing entry in the section PersonEvents. Here is what I have in PHP $mutation = <<<QUERY mutation saveEntry(\$id: ID, \$avatarUrls: ...
Kirk Roberts's user avatar
1 vote
1 answer
128 views

Fetch Category Field Value on Entry Element

I am fairly new to Craft; I have an entry type with a custom field that is a Categories field. I am trying to use GraphQL to return the fields on my entry, including the category field value. Ex. my ...
Adrienne W's user avatar
1 vote
1 answer
24 views

Is there a way to mutate categories through GraphQL for a specific siteId?

The graphQL does not support siteId parameter in category mutation. How could I mutate the content for a specific siteId?
user13530's user avatar
1 vote
1 answer
207 views

GraphQL - Optional relatedTo value

I have a component which lists events and can be configured to filter by category. Query: query Events($filter: [String]) { entries( section: "event" relatedToCategories: {group: &...
Thomas's user avatar
  • 133
1 vote
1 answer
58 views

GraphQL fields with applied typogrify - any suggestions?

we love CraftCMS and also typogrify plugin with Twig filter "|typogrify". Now we are starting a web project that will combine Astro and CraftCMS will be used headless with the use of GraphQL ...
jan.reges's user avatar
2 votes
1 answer
124 views

Adding section to Graphql "View - Public Schema" programatically

So, I am creating new section called "My Section" with handle "mySection" via plugin. All good there. I want to be able for my section to be Viewable via Public Schema each time it ...
b.doe's user avatar
  • 23
1 vote
1 answer
410 views

How to get a list of entry types for a section using GraphQL?

The goal is to get a list of entry types for a section, so that a user can filter entires by entry type e.g. query Entries { entries(section: "content", type: ["news", "...
user13360's user avatar
1 vote
1 answer
512 views

GraphQL query orderBy number including null

I am attempting to query entries via that have a field (ex numberField) with field type Number. Some of the entries don't have a value for this field, so in the response it has null. I am wanting to ...
toddhf's user avatar
  • 11
0 votes
1 answer
258 views

trying to insert super table field values using graphql in craft cms

cant able to store values from super table field,need a correct format to do Graphql mutation saveEntry($superTable: [demoSuperTable_SuperTableBlockContainerInput] = {demoSuperTable_0: {id: "&...
Kishore Natarajan's user avatar
1 vote
1 answer
330 views

How to make a external GraphQL API request?

I want to query some data from another domain. I dont want to to do it in JS (client side) because I want the content right in place on the page. I tried with several options and variations with the ...
Simon Franzen's user avatar
0 votes
0 answers
438 views

Getting GraphQL working with Authorization header

In the docs, the following is written: Apache strips Authorization headers by default, which can be fixed by enabling CGIPassAuth or adding the following to your .htaccess file: RewriteCond %{HTTP:...
obs's user avatar
  • 509
0 votes
1 answer
483 views

GraphQL - Categories with entries

Is it possible to get categories with related entries with one graphQL query? I have the following query: query MyQuery { categories(relatedToEntries: {section: "entryType"}) { id ...
Jørgen's user avatar
  • 165
2 votes
1 answer
117 views

GraphQL IDE doesn't show up in Craft Admin

In config/general.php, I've enabled GraphQL and headless mode like so: "enableGql" => true, "headlessMode" => true, The official docs suggest that there's a built-in IDE for ...
sea_monster's user avatar
1 vote
1 answer
92 views

Returning Metadata Fields with GraphQL?

I'm trying to pull as much information from the CMS as possible via the GraphQL API. I can't seem to find any info about how to extract the metadata information for the various entries in the CMS. At ...
Ailish's user avatar
  • 21
0 votes
0 answers
834 views

Maximum Response Size in GraphQL API?

hoping someone can point me in the right direction here. I'm trying to query my client's API with the Graphiql interface. My use case requires me to extract quite a lot of data from their system but ...
Ailish's user avatar
  • 21
1 vote
1 answer
200 views

CraftCMS Image Transform returning NULL on asset.url when stored on AWS S3 Bucket

So i'm using Craft as a headless CMS with a React frontend. When querying assets on a S3 bucket and applying a transform to them in my GraphQL query the URL response is NULL. This isn't the case when ...
samroberts707's user avatar
1 vote
1 answer
287 views

Runtime Object type "Element" is not a possible type for "MyGraphqlInterface" for custom gql resolver/interface

So, I'm probably taking the wrong approach here, but I am attempting to write a custom graphQL query interface, resolver, DB and graphQL query classes in order to return values from a custom Plugin ...
Eric's user avatar
  • 133
1 vote
0 answers
33 views

Same GraphQL query on production (which gives me what I want), results in 504 time-out locally

I have 2 identical installs local and production. Both servers are nearly identical and when checking Utilities > System Report all requirements are met. When I query for matrix blocks locally, I ...
user2965266's user avatar
1 vote
1 answer
266 views

How do I get custom fields of User on graphQL?

I am wanting to fetch queries for custom fields of users, how would I go about doing that? So if I did something like this: query { users { id firstName lastName email photo { ...
Keatyn Garton's user avatar
1 vote
1 answer
675 views

Creating an entry with a matrix field using GraphQL

I am trying to create a new entry in Craft CMS using GraphQL. The entry has a matrix field called "vehicles" that has a single block called "vehicle". This block has a single field ...
theboldben's user avatar
1 vote
1 answer
254 views

Language prefix in URL with correct entry URIs

I never used Craft before and I'm trying to create a multi-language site (in headless mode) but am running into problems with adding the language to the URL. My goal is to have URLs that always start ...
Thomas's user avatar
  • 133
0 votes
1 answer
471 views

How do you create a GraphQL mutation to upload a file for an entry's asset field?

In my mutation I need to upload a file to an Asset Field. Can this all be done in one mutation or do you need to upload the file in one mutation and assign the id to the asset field in a secondary ...
a-am's user avatar
  • 2,857
1 vote
1 answer
3k views

Return a single element instead of an array in a GraphQL query

Consider the following GraphQL query: { entries { ...on posts_default_Entry { image { id } } } } This will return the following: { "data": { "...
David Jones's user avatar
2 votes
0 answers
59 views

GraphQL next does not accept 'relatedToCategories'

I'm trying to get the next project in the "projects" section but with the same category. So because I can't do it in one query (the value of my category is in the result), I do another query ...
GaelP's user avatar
  • 21
2 votes
1 answer
334 views

How to get enabled entry with GraphQL, enabledForSite has been deprecated?

Based on the docs https://craftcms.com/docs/3.x/graphql.html#the-entries-query enabledForSite can be used for entries. This works for me to get the enabled entries, however I get a deprecation error ...
gellybutton's user avatar
1 vote
1 answer
190 views

Graphql schema causing error on project-config/apply

Craft v3.5.7 First off, graphql is not being used on this site so I'm not sure why the schemas are being generated and causing errors. The graphql.yml file contents: publicToken: enabled: false ...
Sue Malomo's user avatar
1 vote
1 answer
97 views

Why can't I see my programmatically-created Entries in GraphQL/GraphiQL?

I am using a module controller to create Entries, like this: $personEvent = new Entry(); $personEvent->sectionId = 6; $personEvent->typeId = 1; $personEvent->authorId = $user->id; $...
Kirk Roberts's user avatar
1 vote
1 answer
143 views

Graphql mutations with json

Can someone confirm for me that the current status of craftql (Craft 3.7) does not allow mutations that can save JSON content to entries?
joomkit's user avatar
  • 2,014
1 vote
1 answer
2k views

How do I write a GraphQL query to search through sub-entries/entries as fields and return the whole entry?

So I have a fairly complex section structure that (on an Entry Type) has a matrix field that contains entries as fields(sub-entry) within a blocktype. I'd like to write a GraphQL query such that when ...
Eric's user avatar
  • 133
2 votes
1 answer
540 views

Craft CMS GraphQL count query

I've got the GraphQL code posted below, but I'm not sure how do I count the total of returned products . Do I need another query just for the products without offset ? I need it for a pagination ...
varian's user avatar
  • 21
2 votes
1 answer
651 views

Is it possible to write a custom GraphQL resolver for Craft?

I am currently editing a headless VueJS + Craft + GraphQL website and the client asks me to add a Recipe section. I found https://plugins.craftcms.com/recipe which is great, but when I add the field ...
davidwebca's user avatar
1 vote
1 answer
430 views

GraphQL: get prev / next entry from current entry (channel)

Is there a way to get the prev and next entry from the current entry, when this entry is inside a channel and not a structure? query ($id: [QueryArgument], $rel: Int) { entry: entry(id: $id) { ...
davidhellmann's user avatar
1 vote
1 answer
188 views

GraphQL mutation or query, how to target specific site?

Is there a restriction on graphQL that only allows it to work on the primary site? My system has for unknown reason switched primary (and I can't change it back due to a bug), and ever since then my ...
jishi's user avatar
  • 263
1 vote
2 answers
753 views

WARNING: heuristic fragment matching going on! when querying matrix fields or any query with multiple fragment types with Graph QL using Nuxt Apollo

I am relatively new to using Craft Headlessly and am trying to query matrix fields with Nuxt JS and it's Apollo module. I have discovered, that although the graphQL queries work in the GraphiQl ...
ToddPadwick's user avatar
2 votes
2 answers
1k views

Fetching Unique Categories related to Entries via GraphQL

Suppose I have some entries in a section called 'product' that are related to a category call 'brand' - I know I can get the brands that are related to each product that match a search term using ...
Seb Jones's user avatar
2 votes
1 answer
1k views

Updating Entry field with GraphQL mutation

I'm trying out the GraphQL mutations and would like to issue an update of an Entry, triggered from a webhook. However, documentation on mutations seems sparse, and I find GraphQL highly confusing. ...
jishi's user avatar
  • 263
4 votes
1 answer
529 views

Using a GraphQL mutation to append a block to a Neo field

I know how to update simple fields on an entry using a mutation: mutation updateRecipe($recipeId: ID, $slug: String) { save_recipes_recipe_Entry(id: $recipeId, slug: $slug) { id title ...
Jon W's user avatar
  • 81
1 vote
1 answer
248 views

Create folder in asset volume via GraphQL

Is it possible to create a subfolder within an asset volume via GraphQL? If yes, can you point me in the right direction? I just found mutations for file uploading, but nothing for folder creation. ...
Matthias Redl-Mann's user avatar
1 vote
1 answer
276 views

How can I have created data (id) returned for a GraphQL mutation?

I have a mutation which is successfully creating an entry, but the data returned for the mutation does not include the fields I specify, such as id. mutation saveWindowCleaningRequest($title: String!, ...
David Oliver's user avatar
2 votes
1 answer
505 views

Filter for language when using graphQL

I try to use graphQL to get language specific entries from my Craft CMS. I (naively?) tried this: query { entries (section: "newsIntranet", language: "fr") { title ...
dannybucks's user avatar