Closed rburgst closed 1 year ago
is there some trace logging that I can turn on to narrow in on the problem?
@rburgst there are some tips here to try: https://docs.wpgraphql.com/guides/debugging/
First one I would suggest is: define( 'GRAPHQL_DEBUG', true );
But there are some other tips in there as well.
If you're still stuck after going through the tips on that page let me know and we can talk about some other ideas (and ideally get them documented)
getting the following error
{
"errors": [
{
"debugMessage": "You cannot register duplicate fields on the same Type. The field 'content' already exists on the type 'post'. Make sure to give the field a unique name.",
"message": "Internal server error",
"extensions": {
"category": "internal"
}
}
]
}
Since we are using CPT UI and ACF, its hard to say who is responsible for such a double registration.
However this error is quite unrelated to my problem. I deactivated GRAPHQL_DEBUG and now got the following error (by stepping through the source)
Abstract type Page_Institutioninformation_ContentSection must resolve to an Object type at runtime for field Page_Institutioninformation.contentSection with value "{"acf_fc_layout":"text_with_image_left_images_right"}", received "null". Either the Page_Institutioninformation_ContentSection type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.
When editing the page, the ACFs all look ok. Also note that for other pages the query returns a reasonable value.
Hm, after having another look, I cannot find the mentioned ACF field layout in the ACF configuration. However, I noticed that there is a different field group with the same field and other options. The problem was that I was referring to the wrong fieldGroup. After using the correct field group the problem went away. As long as the field layouts had the same name , the problem was not visible.
It would be very nice if the exception errors that I saw during debugging would be sent in the reply (even without GRAPHQL_DEBUG)
I did some debugging on why the error
You cannot register duplicate fields on the same Type. The field 'content' already exists on the type 'post'. Make sure to give the field a unique name.
is coming, however, couldnt find any obvious problems. The registration method is only called once.
@rburgst I hit this very same issue today, except my duplicate field was 'author'.
My post is probably not going to be of much use to you now, but perhaps it may help others hitting this issue. I regret I've not had the time to investigate fully, so I'm not entirely sure what the root of the problem was.
For me, I had the GRAPHQL_DEBUG env set to true (working in dev environment), and also had Advanced Custom Fields: Extended plugin, (v0.8.5) enabled. Once I disabled ACF Extended plugin, or disabled the GRAPHQL_DEBUG env, I could use my GraphQL API again. I didn't actually need the extended ACF plugin, I have an inherited code base, and had re-enabled the plugin believing it to be the reason for another problem I was experiencing while doing stuff on 'acf/load_field_group' filter.
I had the same duplicate fields error this morning on the field ACF_Link
. Updating to the latest ACF seems to have resolved it for me.
"You cannot register duplicate Types to the Schema. The Type 'ACF_Link' already exists in the Schema. Make sure to give new Types a unique name."
Having the same/similar issue perhaps. Any kind of relationship field whether it's Post Object / Page Link / Relationship I'm not getting anything back. It's within flexible content so I don't know if that's having an issue with it. Tried renaming fields / removing field, nothing
Advanced Custom Fields PRO 5.9.5 WPGraphQL for Advanced Custom Fields 0.4.1 WP GraphQL 1.2.6
Nothing showing up for Post Object (no field to reference) Relationship field shows up but errors
I'm still having this issue. Has anyone found any solutions to it?
I'm experiencing this issue now as well:
{
"data": {
"posts": {
"edges": []
}
},
"extensions": {
"debug": [
{
"type": "DUPLICATE_TYPE",
"message": "You cannot register duplicate Types to the Schema. The Type 'ACF_Link' already exists in the Schema. Make sure to give new Types a unique name.",
"type_name": "ACF_Link",
"stack": [
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-content/plugins/wp-graphql/src/Registry/TypeRegistry.php:678",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-content/plugins/wp-graphql/access-functions.php:175",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-includes/class-wp-hook.php:307",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-includes/class-wp-hook.php:331",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-includes/plugin.php:474",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-content/plugins/wp-graphql/src/Registry/TypeRegistry.php:592",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-includes/class-wp-hook.php:307",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-includes/class-wp-hook.php:331",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-includes/plugin.php:474",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-content/plugins/wp-graphql/src/Registry/TypeRegistry.php:230",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-content/plugins/wp-graphql/src/Registry/SchemaRegistry.php:38",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-content/plugins/wp-graphql/src/WPGraphQL.php:600",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-content/plugins/wp-graphql/src/Request.php:151",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-content/plugins/wp-graphql/src/Router.php:459",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-content/plugins/wp-graphql/src/Router.php:265",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-includes/class-wp-hook.php:307",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-includes/class-wp-hook.php:331",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-includes/plugin.php:522",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-includes/class-wp.php:396",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-includes/class-wp.php:758",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-includes/functions.php:1310",
"/home/customer/www/cms.vietnamcoracle.com/public_html/wp-blog-header.php:16",
"/home/customer/www/cms.vietnamcoracle.com/public_html/index.php:17"
]
}
]
}
}
Same here, I Renamed one type and now im getting:
"type": "DUPLICATE_TYPE",
"message": "You cannot register duplicate Types to the Schema. The Type 'theme' already exists in the Schema. Make sure to give new Types a unique name.",
"type_name": "theme",
This plugin has been re-built over here: https://github.com/wp-graphql/wpgraphql-acf
As part of the re-architecture, a LOT of issues have been resolved, including this "DUPLICATE_TYPE" bug.
The new version of the plugin is a lot "smarter" in how it maps the ACF Field Groups to the GraphQL Schema, re-using existing Types, etc.
As part of the re-write, I have an issue where I'm tracking the documentation I'm writing: https://github.com/wp-graphql/wpgraphql-acf/issues/48, and I have a "Debugging" page that will be published as part of that effort.
This repo will be archived in the not-too-distant future in favor of the new version of the plugin which will be released on WordPress.org soon. We encourage you to update to the new version when you can as it's the version we'll be supporting going forward.
💪♥️✅
On Tue, Nov 7, 2023, 5:10 PM Jason Bahl @.***> wrote:
This plugin has been re-built over here: https://github.com/wp-graphql/wpgraphql-acf
As part of the re-architecture, a LOT of issues have been resolved, including this "DUPLICATE_TYPE" bug.
The new version of the plugin is a lot "smarter" in how it maps the ACF Field Groups to the GraphQL Schema, re-using existing Types, etc.
As part of the re-write, I have an issue where I'm tracking the documentation I'm writing: wp-graphql/wpgraphql-acf#48 https://github.com/wp-graphql/wpgraphql-acf/issues/48, and I have a "Debugging" page that will be published as part of that effort.
This repo will be archived in the not-too-distant future in favor of the new version of the plugin which will be released on WordPress.org soon. We encourage you to update to the new version when you can as it's the version we'll be supporting going forward.
— Reply to this email directly, view it on GitHub https://github.com/wp-graphql/wp-graphql-acf/issues/144#issuecomment-1800270283, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADYO6RUL7AUKRQVPRWSHLKTYDKWVLAVCNFSM4NGDYY5KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBQGAZDOMBSHAZQ . You are receiving this because you commented.Message ID: @.***>
I have a fairly large and complex WP + ACF setup and wpgraphql + acf gives me errors:
When I issue a request as follows
I get the following result:
I had a similar issue where a referenced post was not found in
wp-graphql
(see https://github.com/wp-graphql/wp-graphql/pull/1316) but here I am at a loss.I turned on WP_DEBUG and that did not print anything useful either.