Repository navigation
Description
Hi,
Can someone help me with the one issue. I have a page with the ACF repeater filed and I can easily query it using GraphQL IDE. But when I add this query using gql I got 500 server error.
The strange this is that when I query this without any additional stuff in gql I get the results..
Any idea what I'm doing wrong?
`
wp-core
version: 6.4.3
permalink: /%postname%/
https_status: false
multisite: false
user_registration: 0
blog_public: 0
default_comment_status: closed
environment_type: development
user_count: 12
dotorg_communication: true
wp-paths-sizes
wp-active-theme
parent_theme: none
theme_features: core-block-patterns, widgets-block-editor, automatic-feed-links, title-tag, html5, post-thumbnails, customize-selective-refresh-widgets, post-formats, custom-background, custom-logo, responsive-embeds, infinite-scroll, jetpack-responsive-videos, jetpack-social-menu, woocommerce, wc-product-gallery-lightbox, wc-product-gallery-zoom, wc-product-gallery-slider, menus, widgets, editor-style
auto_update: Wyłączono
wp-themes-inactive (4)
Twenty Twenty-Four: version: 1.0, author: zespół WordPressa, Automatyczna aktualizacja jest wyłączona
Twenty Twenty-One: version: 1.4, author: zespół WordPressa (latest version: 2.1), Automatyczna aktualizacja jest wyłączona
Twenty Twenty-Three: version: 1.0, author: zespół WordPressa (latest version: 1.3), Automatyczna aktualizacja jest wyłączona
Twenty Twenty-Two: version: 1.0, author: zespół WordPressa (latest version: 1.6), Automatyczna aktualizacja jest wyłączona
wp-plugins-active (44)
ACF Nav Menu Field: version: 1.3, author: Galaxy Weblinks, Automatyczna aktualizacja jest wyłączona
AcyMailing: version: 7.6.1, author: AcyMailing Newsletter Team (latest version: 9.4.1), Automatyczna aktualizacja jest wyłączona
Add WPGraphQL SEO: version: 4.22.5, author: Ash Hitchcock, Automatyczna aktualizacja jest wyłączona
AdRotate: version: 5.8.25, author: Arnan de Gans (latest version: 5.12.9), Automatyczna aktualizacja jest wyłączona
Advanced Custom Fields: Theme Code Pro: version: 2.5.3, author: Hookturn with Ben Pearson (latest version: 2.5.6), Automatyczna aktualizacja jest wyłączona
Advanced Custom Fields PRO: version: 5.9.4, author: Elliot Condon (latest version: 6.2.7), Automatyczna aktualizacja jest wyłączona
Branda Pro: version: 3.4.8, author: WPMU DEV (latest version: 3.4.17), Automatyczna aktualizacja jest wyłączona
Content Control: version: 1.1.9, author: Code Atlantic (latest version: 2.2.7), Automatyczna aktualizacja jest wyłączona
Convert Post Types: version: 1.4, author: Stephanie Leary, Automatyczna aktualizacja jest wyłączona
Custom Post Type UI: version: 1.12.1, author: WebDevStudios (latest version: 1.15.1), Automatyczna aktualizacja jest wyłączona
Custom recent post widget thumbail seegatesite: version: 1.0, author: Sigit Prasetya Nugroho, Automatyczna aktualizacja jest wyłączona
Custom Sidebars: version: 3.2.3, author: WPMU DEV, Automatyczna aktualizacja jest wyłączona
Defender Pro: version: 3.0.1, author: WPMU DEV (latest version: 4.6), Automatyczna aktualizacja jest wyłączona
Duplicate Page: version: 4.4.8, author: mndpsingh287 (latest version: 4.5.3), Automatyczna aktualizacja jest wyłączona
Elementor: version: 3.6.6, author: Elementor.com (latest version: 3.20.2), Automatyczna aktualizacja jest wyłączona
Elementor Pro: version: 3.7.2, author: Elementor.com (latest version: 3.20.1), Automatyczna aktualizacja jest wyłączona
Faust.js™: version: 1.2.2, author: WP Engine, Automatyczna aktualizacja jest wyłączona
FG Joomla to WordPress Premium: version: 3.66.0, author: Frédéric GILLES, Automatyczna aktualizacja jest wyłączona
FileBird: version: 4.0.5, author: Ninja Team, Automatyczna aktualizacja jest wyłączona
GP Nested Forms: version: 1.0.23, author: Gravity Wiz (latest version: 1.1.53), Automatyczna aktualizacja jest wyłączona
GP Populate Anything: version: 1.2.15, author: Gravity Wiz (latest version: 2.0.35), Automatyczna aktualizacja jest wyłączona
GP Read Only: version: 1.9.8, author: Gravity Wiz (latest version: 1.9.20), Automatyczna aktualizacja jest wyłączona
GP Terms of Service: version: 1.4.1, author: Gravity Wiz (latest version: 1.4.5), Automatyczna aktualizacja jest wyłączona
GP Word Count: version: 1.6, author: Gravity Wiz (latest version: 1.6.3), Automatyczna aktualizacja jest wyłączona
Gravity Forms: version: 2.6.9, author: Gravity Forms (latest version: 2.8.6), Automatyczna aktualizacja jest wyłączona
Gravity Perks: version: 2.2.7, author: Gravity Wiz (latest version: 2.3.6), Automatyczna aktualizacja jest wyłączona
Hustle Pro: version: 4.5.0, author: WPMU DEV (latest version: 7.8.4), Automatyczna aktualizacja jest wyłączona
Loco Translate: version: 2.6.2, author: Tim Whitlock (latest version: 2.6.7), Automatyczna aktualizacja jest wyłączona
Post Type Switcher: version: 3.2.1, author: Triple J Software, Inc. (latest version: 3.3.1), Automatyczna aktualizacja jest wyłączona
QL Events: version: 0.0.1, author: kidunot89, Automatyczna aktualizacja jest wyłączona
Query Monitor: version: 3.10.1, author: John Blackbourn (latest version: 3.15.0), Automatyczna aktualizacja jest wyłączona
Regenerate Thumbnails: version: 3.1.5, author: Alex Mills (Viper007Bond) (latest version: 3.1.6), Automatyczna aktualizacja jest wyłączona
Safe SVG: version: 2.0.1, author: 10up (latest version: 2.2.3), Automatyczna aktualizacja jest wyłączona
Sticky Block: version: 1.1, author: Senff (latest version: 1.11), Automatyczna aktualizacja jest wyłączona
The Events Calendar: version: 5.16.1.1, author: The Events Calendar (latest version: 6.3.5), Automatyczna aktualizacja jest wyłączona
The Events Calendar: Filter Bar: version: 5.3.1, author: The Events Calendar (latest version: 5.5.4), Automatyczna aktualizacja jest wyłączona
The Events Calendar Extension: Main Blog Loop: version: 1.0.1, author: Modern Tribe, Inc., Automatyczna aktualizacja jest wyłączona
The Events Calendar PRO: version: 5.14.2.1, author: The Events Calendar (latest version: 6.3.2), Automatyczna aktualizacja jest wyłączona
User Menus: version: 1.2.9, author: Code Atlantic (latest version: 1.3.2), Automatyczna aktualizacja jest wyłączona
WPGraphQL: version: 1.22.1, author: WPGraphQL, Automatyczna aktualizacja jest wyłączona
WPGraphQL Content Blocks: version: 3.0.0, author: WP Engine, Automatyczna aktualizacja jest wyłączona
WPGraphQL for ACF: version: 2.2.0, author: WPGraphQL, Jason Bahl, Automatyczna aktualizacja jest wyłączona
WPMU DEV Dashboard: version: 4.11.25, author: WPMU DEV, Automatyczna aktualizacja jest włączona
Yoast SEO: version: 20.1, author: Team Yoast (latest version: 22.3), Automatyczna aktualizacja jest wyłączona
wp-plugins-inactive (12)
Asset CleanUp: Page Speed Booster: version: 1.3.8.5, author: Gabe Livan (latest version: 1.3.9.3), Automatyczna aktualizacja jest wyłączona
Enable jQuery Migrate Helper: version: 1.3.0, author: The WordPress Team (latest version: 1.4.0), Automatyczna aktualizacja jest wyłączona
GP Populate Anything - Google Sheets Object Type: version: 0.1.3, author: Gravity Wiz, Automatyczna aktualizacja jest wyłączona
Hummingbird Pro: version: 3.3.4, author: WPMU DEV (latest version: 3.7.3), Automatyczna aktualizacja jest wyłączona
LuckyWP ACF Menu Field: version: 1.0, author: LuckyWP, Automatyczna aktualizacja jest wyłączona
Shipper Pro: version: 1.2.12, author: WPMU DEV (latest version: 1.2.16), Automatyczna aktualizacja jest wyłączona
SmartCrawl Pro: version: 3.0.0, author: WPMU DEV (latest version: 3.10.2), Automatyczna aktualizacja jest wyłączona
Smush Pro: version: 3.12.5, author: WPMU DEV (latest version: 3.16), Automatyczna aktualizacja jest wyłączona
Snapshot Pro: version: 4.8.2, author: WPMU DEV (latest version: 4.24), Automatyczna aktualizacja jest wyłączona
The Events Calendar Category Colors: version: 7.0.6, author: Andy Fragen, Barry Hughes (latest version: 7.3.0), Automatyczna aktualizacja jest wyłączona
WPGraphQL for Advanced Custom Fields: version: 0.6.1, author: WPGraphQL, Jason Bahl, Automatyczna aktualizacja jest wyłączona
WP User Frontend Pro - professional: version: 3.4.4, author: weDevs, Automatyczna aktualizacja jest wyłączona
wp-media
image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1808
imagemagick_version: ImageMagick 7.1.0-4 Q16 x86_64 2021-07-18 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: 1
post_max_size: 64M
upload_max_filesize: 64M
max_effective_size: 64 MB
max_file_uploads: 20
imagick_limits:
imagick::RESOURCETYPE_AREA: 252 GB
imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
imagick::RESOURCETYPE_FILE: 6144
imagick::RESOURCETYPE_MAP: 252 GB
imagick::RESOURCETYPE_MEMORY: 126 GB
imagick::RESOURCETYPE_THREAD: 1
imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3G2, 3GP, AAI, AI, APNG, ART, ASHLAR, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CUBE, CUR, CUT, DATA, DCM, DCX, DDS, DFONT, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, FARBFELD, FAX, FF, FILE, FITS, FL32, FLV, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, KERNEL, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MSL, MSVG, MTV, MVG, NULL, ORA, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PES, PFA, PFB, PFM, PGM, PGX, PHM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAS, RGB, RGB565, RGBA, RGBO, RGF, RLA, RLE, RSVG, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TM2, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMV, WPG, X, XBM, XC, XCF, XPM, XPS, XV, XWD, YAML, YCbCr, YCbCrA, YUV
gd_version: bundled (2.1.0 compatible)
gd_formats: GIF, JPEG, PNG, WebP, BMP
ghostscript_version: 9.54.0
wp-server
server_architecture: Linux 5.12.13 husak_new_cgroup+ x86_64
httpd_software: Apache
php_version: 8.3.3 64bit
php_sapi: uwsgi
max_input_variables: 1000
time_limit: 30
memory_limit: 1512M
max_input_time: 60
upload_max_filesize: 64M
php_post_max_size: 64M
curl_version: 7.78.0 OpenSSL/1.1.1l
suhosin: false
imagick_availability: true
pretty_permalinks: true
htaccess_extra_rules: true
current: 2024-03-25T21:35:08+00:00
utc-time: Monday, 25-Mar-24 21:35:08 UTC
server-time: 2024-03-25T22:34:54+01:00
wp-database
extension: mysqli
server_version: 5.7.42-46
client_version: mysqlnd 8.3.3
max_allowed_packet: 8388608
max_connections: 500
wp-constants
WP_HOME: undefined
WP_SITEURL: undefined
WP_MEMORY_LIMIT: 1512M
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: true
WP_DEBUG_DISPLAY: false
WP_DEBUG_LOG: true
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: development
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8mb4
DB_COLLATE: undefined
wp-filesystem
wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
`
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields✅ Closed
Activity
jasonbahl commentedon Mar 25, 2024
@muskey12 can you elaborate what you mean by:
The strange this is that when I query this without any additional stuff in gql I get the results..What "additional stuff"?
muskey12 commentedon Mar 25, 2024
@jasonbahl
Here are my variables and query:
Variables:
`
Component.variables = ({ databaseId }, ctx) => {
return {
databaseId,
headerLocation: MENUS.PRIMARY_LOCATION,
footerLocation: MENUS.FOOTER_LOCATION,
ourStuffLocation: MENUS.THEOURSTUFF_LOCATION,
newsLocation: MENUS.THENEWS_LOCATION,
workLocation: MENUS.THEWORK_LOCATION,
asPreview: ctx?.asPreview,
};
};
`
Query:
Component.query = gql${BlogInfoFragment}
${NavigationMenu.fragments.entry}
${FeaturedImage.fragments.entry}
query GetPageData(
$databaseId: ID!
$headerLocation: MenuLocationEnum
$footerLocation: MenuLocationEnum
$ourStuffLocation: MenuLocationEnum
$newsLocation: MenuLocationEnum
$workLocation: MenuLocationEnum
$asPreview: Boolean = false
) {
page(id: $databaseId, idType: DATABASE_ID, asPreview: $asPreview) {
title
content
organyIgwp {
czlonekIgwp {
imieINazwisko
przewodniczacy
tytul
wyrozniony
zdjecie {
cursor
node {
altText
sourceUrl
uri
mediaDetails {
width
height
file
meta {
copyright
focalLength
shutterSpeed
iso
camera
}
}
}
}
}
prezes
}
date
opcjeStrony {
pokazacDate
dodatkoweMenu
}
parentDatabaseId
template {
templateName
}
...FeaturedImageFragment
}
generalSettings {
...BlogInfoFragment
}
footerMenuItems: menuItems(where: { location: $footerLocation }) {
nodes {
...NavigationMenuItemFragment
}
}
headerMenuItems: menuItems(where: { location: $headerLocation }) {
nodes {
...NavigationMenuItemFragment
}
}
newsMenuItems: menuItems(where: { location: $newsLocation }) {
nodes {
...NavigationMenuItemFragment
}
}
workMenuItems: menuItems(where: { location: $workLocation }) {
nodes {
...NavigationMenuItemFragment
}
}
ourStuffMenuItems: menuItems(where: { location: $ourStuffLocation }) {
nodes {
...NavigationMenuItemFragment
}
}
}
;jasonbahl commentedon Mar 25, 2024
So what works and what doesn't work?
It sounds like it works in GraphiQL and also when using
gql, but sometimes you get a 500 response?Is the 500 only on certain pages? or can you reproduce it consistently? I feel like there's a lot of missing information to be able to help here.
jasonbahl commentedon Mar 25, 2024
What are the variables you're passing? are the JSON formatted? is the JSON valid? I see you have a lot of ENUMs, when you pass them in the GraphQL IDE you pass them like
ENUM_NAMEbut in JSON they need to be in quotes to be valid JSON like"ENUM_NAME"muskey12 commentedon Mar 25, 2024
Is it possible that query is too big?
muskey12 commentedon Mar 25, 2024
When I remove the
nodefrom the query all worksBut with the
nodeit is notThe 500 is only on this page with this query.
ENUMS are valid and works well on other pages
jasonbahl commentedon Mar 25, 2024
Can you clarify what you mean by this statement?
the exact same query works if you query
page-abut fails if you querypage-b?muskey12 commentedon Mar 25, 2024
@jasonbahl
Maybe I write in wrong.. The query for this page is not working
On this template file.
I have
wp-template/page.tsxwith the query${BlogInfoFragment} ${NavigationMenu.fragments.entry} ${FeaturedImage.fragments.entry} query GetPageData( $databaseId: ID! $headerLocation: MenuLocationEnum $footerLocation: MenuLocationEnum $ourStuffLocation: MenuLocationEnum $newsLocation: MenuLocationEnum $workLocation: MenuLocationEnum $asPreview: Boolean = false ) { page(id: $databaseId, idType: DATABASE_ID, asPreview: $asPreview) { title content date opcjeStrony { pokazacDate dodatkoweMenu } parentDatabaseId template { templateName } parent { node { ... on Page { title opcjeStrony { pokazacDate dodatkoweMenu } } } } ...FeaturedImageFragment } generalSettings { ...BlogInfoFragment } footerMenuItems: menuItems(where: { location: $footerLocation }) { nodes { ...NavigationMenuItemFragment } } headerMenuItems: menuItems(where: { location: $headerLocation }) { nodes { ...NavigationMenuItemFragment } } newsMenuItems: menuItems(where: { location: $newsLocation }) { nodes { ...NavigationMenuItemFragment } } workMenuItems: menuItems(where: { location: $workLocation }) { nodes { ...NavigationMenuItemFragment } } ourStuffMenuItems: menuItems(where: { location: $ourStuffLocation }) { nodes { ...NavigationMenuItemFragment } } }and there is all good.
But here I created additional
wp-template/page-stuff.tsxAnd I only add only this to query
organyStuff { czlonekStuff { imieINazwisko przewodniczacy tytul wyrozniony zdjecie { cursor node { altText sourceUrl uri mediaDetails { width height file meta { copyright focalLength shutterSpeed iso camera } } } } } prezes }and I get 500
theodesp commentedon Mar 26, 2024
@muskey12 can you run the same query that you have in
gqlwithin WP GraphQL IDE and check if there are errors?Also if you try the latest nightly release version of
faustwp-corewe've added error logging for errors so you might able to see extra information.#1816
muskey12 commentedon Mar 26, 2024
@theodesp Hi, as I mentioned at the beginning I can run this query successfully in WP GraphQL IDE without errors.

I have the latest faustwp-core installed and I see only this:
theodesp commentedon Mar 26, 2024
Hey @muskey12 did you update the
possibleTypes.jsonlist as. well?muskey12 commentedon Mar 26, 2024
@theodesp Yes, I did
muskey12 commentedon Mar 26, 2024
As I mentioned before I can easily query
organyStuff { czlonekStuff { imieINazwisko przewodniczacy tytul wyrozniony zdjecie { cursor node { altText sourceUrl uri mediaDetails { width height file meta { copyright focalLength shutterSpeed iso camera } } } } } prezes }but only when I cut something from the rest of the query. For example related with the menusnewsMenuItems: menuItems(where: { location: $newsLocation }) { nodes { ...NavigationMenuItemFragment } } workMenuItems: menuItems(where: { location: $workLocation }) { nodes { ...NavigationMenuItemFragment } } ourStuffMenuItems: menuItems(where: { location: $ourStuffLocation }) { nodes { ...NavigationMenuItemFragment } }EDIT:
It's look like it get stuck at
nodeThere are information about the image

theodesp commentedon Mar 27, 2024
Hey @muskey12 can you use the output of this console log statement and run it exactly on your IDE?
This will give you the exact query that the client is sending to the WPGRaphQL Endpoint.
Hopefully we will be able to reproduce.
muskey12 commentedon Mar 27, 2024
@theodesp Hi, Yes I can run it and works as expected in the IDE

theodesp commentedon Mar 27, 2024
OK so maybe it could be the GET query limit?
Can you reproduce with
useGETForQueries: false,muskey12 commentedon Mar 27, 2024
@theodesp finally ... it works!
Thank you very much.
As I can see, this change the default method to POST right?
Does this change other functionalities in any way? Is there anything I need to pay attention to after this change?
jasonbahl commentedon Mar 27, 2024
@muskey12 POST requests always bypass the network cache and will hit the WordPress server and database. I would recommend using GET requests still as you will likely run into performance issues in production if you use POST requests.
When you have REALLY long queries like this, Persisted Queries help solve that as you can store a query and then use the ID of the query via GET request instead of using the full query string.
Check out this guide and scroll to the section on "Using Persisted Queries": https://faustjs.org/guide/how-to-use-apollo-in-faust
muskey12 commentedon Mar 27, 2024
@jasonbahl thank you I need to take a look on this.
Once again than you very much guys
theodesp commentedon Mar 28, 2024
@muskey12 Thanks. I will move this Issue to the conversations section for reference.