Questions tagged [wp-graphql]
107 questions
7
votes
2 answers
How to get term meta WPGraphQL/WooGraphQL?
I'm using Woo GraphQL and I'm wondering how I should go about getting the color of product attributes. See below for a screenshot of the product attribute in WP Admin:
I've tried querying for the top-level pa- attribute and I've tried querying in…

Rico Kahler
- 17,616
- 11
- 59
- 85
5
votes
1 answer
WPGraphQL query by custom post type taxonomies
Currently I have created custom post type with custom taxonomies called "Countries" and "Practice areas". And in case of simple posts I can just do:
But with custom taxonomies I can't do the same.
My goal is to query all persons that contains…

asdasd
- 63
- 1
- 8
4
votes
1 answer
How to add custom filters on graphql-wp advanced custom fields
I am trying to add a new filter for a custom field defined with the Advanced Custom Fields plugin.
I want to filter on the age of artists, I looked up some documentation but got confused in the progress. (I am a wordpress newbie)
I have added the…

TheAlphaKarp
- 159
- 2
- 13
4
votes
1 answer
Showing Draft and Pending Posts with WpGraphQL
I am using the wpgraphql plugin. For the most part, it is working. However, I can only query posts whose status is published. Posts with a status of pending or draft do not show up.
In other words, here is my query:
query MyQuery {
…

Moshe
- 6,011
- 16
- 60
- 112
3
votes
0 answers
Apollo client reaching the wrong httpEndpoint URL when using external config file
I'm building a nuxt2 website getting all data from a headless Wordpress using wp-graphql and apollo.
As I need possibleTypes data, I've externalized the clientConfigs to another files, here's the info:
nuxt.config.js
...
apollo: {
…

jminguely
- 83
- 10
3
votes
1 answer
WPGraphQL: Custom Post Types query using SLUG as unique identifier returns no data
I've created a Custom Post Type in WordPress named "projects" and now I'm trying to query a single project using the slug as an identifier. In other words, I want the idType to be the SLUG, not ID. I tried the following query but it does not…

victorcngo
- 61
- 4
3
votes
2 answers
Gatsby graphiQL - Cannot return null for non-nullable field ImageSharpFluid.src
I'm using Gatsby and graphql with headless WordPress for a website.
I want to use a gatsby-image plugin to get srcSet and blurring effect for images that are coming from WordPress, but it throws an error in graphiQL playground. I want to explain…

Daniel Barbakadze
- 201
- 2
- 14
3
votes
3 answers
Why do my GraphQL Link shows query error in WordPress
I installed WPGraphQL plugin on my wordpress dashboard but And I tried accessing it via mysite/graphql
I got this error
{"errors":[{"message":"GraphQL Request must include at least one of those two parameters: \"query\" or…

Adewale Perfect
- 553
- 1
- 5
- 12
3
votes
2 answers
Problem with getting RAW format of excerpt in WPGraphQL using Apollo
When I try to get an excerpt from WPGraphQL plugin and pass excerpt(format: RAW) in the query, it's working fine in the WPGraphiQL window, but when I'm executing the same query in Vue Apollo it's always returning null.
Here is my code:
apollo: {
…

mihauke
- 31
- 3
2
votes
0 answers
Get all the related posts except the current post using WPGraphQl in reactjs
I'm trying to grab the related posts except the current post using WPGraphQL. My thought is to exclude the ID of the current post and display all related blog posts within the category.
I'm new to GraphQL, I don't know how to figure out to solve it.…

Devbuddy
- 231
- 4
- 15
2
votes
0 answers
Custom ACF Gutenberg blocks not appearing in WPGraphQL schema
I'm going for a headless setup with WordPress as my CMS. To achieve this, I'm using the following WordPress plugins:
Advanced Custom Fields PRO - Using pro version in order to get the blocks option
WP GraphiQL
WP GraphQL
WPGraphQL for Advanced…

Freddy
- 683
- 4
- 35
- 114
2
votes
1 answer
WP GraphQL query only returns first 100 posts when generating sitemap
I am creating a dynamic sitemap and am trying to pull in all of the blog posts to include in the sitemap. The WP GraphQL Query in the GraphiQL IDE within WP shows all the posts, but when executing the code, it's only showing the first 100. I might…

Nick
- 1,471
- 2
- 21
- 35
2
votes
1 answer
CORS issue fetching data with WPGraphQL and Next.JS
I have created a Next.js app using Wordpress as a CMS and WPGraphQL to fetch data.
I have created apollo-client the following way:
uri: process.env.NEXT_PUBLIC_WP_API_URL,
headers: {
'Authorization':…

benjdan
- 169
- 2
- 6
2
votes
1 answer
How to make a post file using nested getStaticPaths in a category using getStaticPaths? (Using API)
[Next.js]
Using Headless CMS WordPress and the plugin [WPGraphQL],
I was able to create a list of categories by calling the API in getStaticPaths.
src
--pages
----category
------[slug.tsx]
--------page
----------[pageNo.tsx]
The following…

oscar
- 29
- 5
2
votes
0 answers
WPGraphQL - querying custom post types
How to query custom post types by custom taxonomy term? For example, I have custom post type “Courses” and custom taxonomies “City” and “Subject”. I want to query all courses that contain city: Warsaw and subject: excel.
In case of posts I can do it…

Marek Foltas
- 31
- 1
- 3