Questions tagged [wp-graphql]

107 questions
0
votes
1 answer

NextJS, Apollo, WPGraphQL & Combining or Retrieving more than 100 Records

I am trying to retrieve more than 100 records for a WPGraphQL query using Apollo during getStaticProps. The wonderful WPGraphQL maker, Jason, pointed me towards using the pagination method and then combining the results into one new Array (or…
sylargaf
  • 346
  • 1
  • 6
  • 19
0
votes
0 answers

GraphQL Query by Object

I am new to basically everything; js, graphql etc. But I am using WP GraphQL to get content out of my Wordpress installation to populate a app I made in NextJS. I've managed to get WP GraphQL to do what I need it to do, but now I need to figure out…
sylargaf
  • 346
  • 1
  • 6
  • 19
0
votes
0 answers

Get posts in draft mode with WPGraphQL

Using headless WordPress and WPGraphQL, when a page is set to draft status, and I try to pull in pages into my React navigation, the site breaks. How can I either filter out pages/posts that are set to draft status, or pull them in and then filter…
Matt
  • 1,561
  • 5
  • 26
  • 61
0
votes
1 answer

WPGraphQL useMutation GraphQL error: Unknown argument "username" on field "registerUser" of type "RootMutation"

I'm building a headless wordpress website using react, nextjs and wpgraphql. I'm trying to create a mutation to register user, but I'm getting the following errors after submitting my form: Error: GraphQL error: Unknown argument "username" on field…
Carlos G
  • 479
  • 1
  • 8
  • 19
0
votes
0 answers

Show ACF queries in allTribeEvents (The Events Calendar)

I am currently developing a Gatsby site with Wordpress as a headless CMS. Our customer wants to manage events, for which I use The Events Calendar as a plugin. To be a bit more flexible, I have also integrated Advanced Custom Fields, so that as soon…
0
votes
1 answer

WPGraphQL Query by URI returns null on custom post type

I have a custom post-type that I am trying to query by URI, my query looks like this but doesn't work: query { article(id:"/category/child-category/article-name/", idType:URI) { slug, uri } } If I do the same using the DATABASE_ID to…
huge-iguana
  • 195
  • 2
  • 2
  • 11
0
votes
1 answer

list_of Posts in WPGraphQL

I'm creating a new Gutenberg ACF Block. I want to be able to dynamically provide a list of Post objects in GraphQL for Gatsby to read. Here is my code which works in WordPress GraphiQL and in Gatsby's GraphQL to return a single Post. Gutenberg Block…
Ourx
  • 109
  • 3
  • 15
0
votes
2 answers

Efficiently get product categories related to products with GraphQL (WPGraphQL for Wordpress)

I'm using Wordpress, Woocommerce, WooGraphQL, React and Next for a headless eCommerce solution, utilizing SSG and SSR for SEO and performance. I'm concerned about performance when it comes to populating product filters on category pages. I only want…
Lee Buckle
  • 589
  • 7
  • 16
0
votes
2 answers

GraphQL (WP) get a custom post by uri

I'm following one of the tutorials on youtube on performing basic query on headless wordpress api with GraphQL. The query that the tutorial (over a year old now) does is: query getBookBySlug($slug: String) { book: bookBy(uri: $slug) { …
Wasteland
  • 4,889
  • 14
  • 45
  • 91
0
votes
0 answers

WPGraphQL query fragments for multiple post types

I want to create a query fragment that I can use to query regular WordPress posts and custom post types which share the same properties. Assume I have the following code using graphql aliases: query getData($includeCategory: Boolean!) { wp { …
LionOnTheWeb
  • 326
  • 2
  • 16
0
votes
0 answers

How to update nested item in GraphQL wp-graphql

I am trying to edit one of Custom Post Types Ranking so that the upvotes field inside Ranking > ranking > rankingsPost > upvotes = 1. I cannot seem to do this with a mutation in wp-graphql. mutation MyMutation { __typename updateRanking(input:…
Jamie Hutber
  • 26,790
  • 46
  • 179
  • 291
-1
votes
1 answer

Wpgraphql queries under fetching queries from wordpress

I have this issue were I'm trying to request images I've uploaded on my WordPress instance with graphql from Gatsby but I only get the most recent item I uploaded on wordpress. When i query using the Graphiql IDE on WordPress I the desired results.…
-1
votes
2 answers

Gatsby: How can I pass multiple context IDs to a single query?

I'm trying to get data from two separate objects in a single query using their WordPress IDs, but I'm getting GraphQLError: The ID input is invalid. Make sure you set the proper idType for your input. Using the GraphQL IDE in WordPress it fetches…
mikeriley131
  • 353
  • 6
  • 15
-1
votes
1 answer

Is this a security issue for WP GraphQL (wordpress)?

Using postman I query: query MyQuery { users { nodes { id email } } With an authenticated request (and admin rights), I get: { "data": { "users": { "nodes": [ { …
but-why
  • 533
  • 3
  • 10
-1
votes
2 answers

Gatsby and WordPress graphQL : query multiple images by id

I am trying to recreate a WordPress slider on Gatsby I want to see if there is a way to query multiple images by id. I don't want to use many queries but a single one using an array of IDs - if it's possible of course :-) What the query would be for…
Giannis Dallas
  • 648
  • 2
  • 8
  • 27