Questions tagged [graphql]

The tag has no usage guidance.

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

GraphQL query order entries by Lightswitch and DateTime field

I have an entries with the "highlighted" lightswitch that puts entry on top of the result list when enabled, also I need to sort items by post date. So, in the end there should be the ...
1
vote
1answer
52 views

GraphQL query entries by DateTime field between two dates

I am trying to query entries in GraphQL by custom DateTime field value. It works with the base String value like ">=2020-10-01", However querying between two dates like "['and', '>...
0
votes
0answers
7 views

Ge tTags from the list of displayed entries #GraphQL

query QueryEntries($section: [String]) { entries(section: $section) { id } } Result { "data": { "entries": [ { "id": "369" ...
0
votes
0answers
11 views

External GraphQL API support with Twig

I have external GraphQL API's to get data which will be used in Twig Templates. This has nothing to do with Craft data or Craft's content. Is there a way to call GraphQL from Twig template instead of ...
1
vote
1answer
26 views

How can I change the Date Created for Assets?

I'm using graphql to pull in some assets/pdfs and ordering them by dateCreated, however the files go back a few years (i.e. files from 2019, files from 2018 etc.) but they weren't uploaded in the ...
0
votes
0answers
45 views

Modifying a GraphQL element query using a custom field

There’s an address field plugin that doesn't yet support GraphQL, but I'd like to re-create something that I could do using Twig in GraphQL based on this plugin’s custom field. In Twig you would do ...
1
vote
0answers
48 views

Filter entries in GraphQL

I'm using Craft with Gatsby. I'd like to query a featuredpost, and filter that in my entries. I'm getting the featuredPost slug in gatsby-node, and passing that to createPage, to send a variable to my ...
1
vote
1answer
51 views

Uploading Asset Doesn't Clear GraphQl Cache with VueJS/Axios

Context: I have a VueJS method that uses a form and Axios to upload an asset to an entry's asset field. The method successfully uploads the asset to the entry, and I can prove that fact via the ...
1
vote
1answer
185 views

Graphql total results / pageinfo when searching with pagination

I'm trying to build something to search my data that is stored in Craft with graphql. To make pagination work I want to know how many results there are in total. I'm doing a query like this: query($...
1
vote
1answer
36 views

Query for Lightswitch in GraphQL

I have two entry types that I want to show in a sorted list (by postDate, with paginating). { entries( type: ["entryType1", "entryType2"], orderBy: "postDate desc", limit: 5, offset:...
1
vote
1answer
87 views

GraphQL: Prevent users seeing entries authored by other users

How can we filter what entries are returned by a GraphQL query so that users cannot see entries authored by other people? For example, Editors can access everything but Writers can only access their ...
0
votes
0answers
20 views

Setting custom headers for GraphQl

Currently testing an Angular + Apollo build with Craftcms and Graphql. The angular app uses angular-token which has an interceptor to the HTTP requests adding additional headers (access-token being ...
2
votes
1answer
108 views

CraftCMS + GraphQL - orderBy Random?

I'm currently building my first JAM stack app using Nuxt as my front-end framework and Craft as my headless CMS. I'm leveraging Apollo as my GraphQL interface client. I have it pulling data back just ...
1
vote
0answers
122 views

In GraphQL how to query entries where related entry has a specific value

Lets have this query: query test { entries(section: "vacancies") { title ... on vacancies_vacancies_Entry { description organisation { title ... on ...
1
vote
1answer
211 views

How to return custom fields in GraphQL

This is definitely a noob question, but I can't seem to find an answer to this. (Completely new to GraphQL). I'm trying to simply return entries: query test { entries(section: "vacancies", limit: ...
1
vote
1answer
73 views

getting active userid by GraphQL?

I build a SPA with Craft CMS and Vue. I use Vue Router and have three Props. Here is my current router-view: <router-view csrfName="{{craft.app.config.general.csrfTokenName}}" csrfToken="{{...
1
vote
1answer
151 views

GraphQL two image transforms for same field

To get image transform in GraphQL we use this image { url @transform ([width: 300, immediately: true]) } But how do I get two different image transforms (for responsive image) for this asset ...
1
vote
0answers
399 views

Multiple Entry Types on GraphQL Fragment

So I am building out a Gatsby Site, which is using Craft in Headless mode as it's content source. In one Section, I have three entry types. Currently they have identical fields, but may diverge in the ...
0
votes
0answers
89 views

Is it possible to query entries based on values in a table field using GraphQL?

Is there a way to query table values using GraphQL, I see that it's expecting [QueryArgument], but I'm not sure how to use it. I would like to query entries where myTable has a row where col1 (text ...
1
vote
1answer
376 views

GraphQL - Get related entries based on tags field

I'm trying to retrieve entries related to the current entry, based on a tag field called topics. Simple stuff. Now, I use Craft's native GraphQL implementation so I'm bound to the possibilities this ...
1
vote
1answer
42 views

How to loop through Craft CMS query in Angular

Given the following query sample, how can I loop through the entries past the first array in Angular? Here is the query sample: query sample ($section: [String], $type: [String], $slug: [String]) { ...
2
votes
1answer
130 views

How can I retrieve Users of a specific User Group with GraphQL?

I want all the users but filtered by User Group: query getAllUsers { users { id, username } } I cannot see any query parameter on the Schema
1
vote
1answer
79 views

GraphQL private schema returning public schema scope

I am setting up GraphQL on my Craft project, v3.3.16.3 I have a public schema exposing a public entry type, and a private schema exposing a private entry type. When I switch between them in the ...
1
vote
2answers
266 views

How to get previous and next entry using the native GraphQL API?

How do I turn these Craft queries into a GraphQL one? // entry.twig entry.getPrev({ section: "contentHub" }) entry.getNext({ section: "contentHub" }) I want to get the previous and next entry using ...
3
votes
1answer
434 views

Asset field empty in graphql query response

I have a problem with a graphql query which includes an asset field. The asset field is always an empty array. There are no errors in the graphiql tool. The graphql api is not public unfortunately ...
0
votes
0answers
339 views

Vue + Apollo + CraftQL

I'm starting to dive deeper w/Vue + Apollo + CraftQL but I'm not getting any data on my http://localhost:8080/ but it is mostly working on my Laravel Valet host of https://hybridinteractive.test/test....