Questions tagged [wp-graphql]

107 questions
0
votes
2 answers

Query not working within [slug].js file in nextjs - using acf

I've recently set up a Next.js project along with a headless Wordpress CMS. My posts & pages are using custom Gutenberg blocks to pull content through. I've set up the following plugins on the CMS: WP GraphQl, WP GraphQL Gutenberg, WPGraphQL for…
0
votes
1 answer

Authorized queries with Apollo in Next.js application

I'm working on a PWA developed with Next.js that has to read data from a Wordpress site and I'm pretty new to these technologies. I have these Wordpress plugins installed: WPGraphQL WPGraphQL CORS WPGraphQL JWT Authentication Specifically, the…
Andrea
  • 105
  • 1
  • 10
0
votes
2 answers

WpGraphQL query returns null

I'm having this GraphQL query from headless Wordpress in Nexjs via WpGraphQl plugin: export const GET_POSTS_BY_CATEGORY_SLUG = gql` query GET_POSTS_BY_CATEGORY_SLUG( $slug: String, $uri: String, $perPage: Int, $offset: Int ) { ${HeaderFooter} …
Ilir
  • 488
  • 5
  • 20
0
votes
0 answers

Getting the categoryId of a post in Graphql

This is my Graphql query for getting posts from headless wordpress: export const GET_POSTS = gql` query GET_POSTS( $uri: String, $perPage: Int, $offset: Int, $categoryId: Int ) { posts: posts(where: { categoryId: $categoryId, offsetPagination:…
Ilir
  • 488
  • 5
  • 20
0
votes
2 answers

How to get Custom Field data on WPGraphQL

How to get Custom Field data on WPGraphQL I add a custom field for upload featured image for category. Now I want to get this value on WPGraphQL Query.
Raju Ahammad
  • 873
  • 2
  • 9
  • 15
0
votes
2 answers

Formatting date in Javascript for Sitemap

I am working with a sitemap where the modified date that is being pulled from WP GraphQL is incorrectly formatted which looks like 2021-11-24T17:03:44.597Z. Looking at Google's recommendations it suggests something like: 2021-11-24T16:02:05+00:00 Is…
Nick
  • 1,471
  • 2
  • 21
  • 35
0
votes
0 answers

No 'Access-Control-Allow-Origin' header is present using Axios to post a comment

[ A CORS policy error ] [ Gridsome as front and Axios for HTTP requests ] [ WP-Graphql v1.6.7 ] [ WPGraphQL Cors installed ] [Access to XMLHttpRequest at ''https://my_wp_backend.com' from origin 'http://my_gridsome_front.com' has been blocked by…
Ali Seivani
  • 496
  • 3
  • 21
0
votes
0 answers

Undefined data after client-side rendering with Next.js and WPGraphQL

I have created an app using Next.js, Apollo, and I fetch data with WPGraphQL. So far I have been able to fetch data using getStaticProps() and getServerSideProps() on pages files. However it doesn't work with client-side rendering in Components as…
benjdan
  • 169
  • 2
  • 6
0
votes
1 answer

GraphQL mutation in Svelte to submit a comment in Wordpress

How to submit a comment in svelte using Graphql? My svelte code is like this