Closed blakewilson closed 2 years ago
This appears to be caused by the fact that we don't register post types as public
. Trying publicly_queryable
set to true, while public
still being false, does not fix it. Seems like we might be forced to register with public => true
for this query type to work.
As a test, commenting out this line in WPGraphQL makes the query work:
I wonder what the reasoning is for WPGraphQL to check for public
+ show_in_graphql
. Is the latter not sufficient? If not, is there a chance of changing that to publicly_queryable
instead? Just looking at all our options here. cc @jasonbahl
Is the post type hierarchical?
If so, slug should not be an identifier for the type, because you can have multiple entries of the same post type with the same slug.
For example, you could have:
All with a slug of john
but a uri of:
That said, I do think @mindctrl has pointed out a bug with WPGraphQL🤔
I believe I've not encountered the bug, because post types I've tested with have all been public!
I think we can get rid of the public => true
arg here
This appears to be caused by the fact that we don't register post types as public.
Related: https://github.com/wpengine/atlas-content-modeler/issues/290.
@jasonbahl , I've opened up https://github.com/wp-graphql/wp-graphql/pull/2132 per the feedback above to address.
This was fixed in https://github.com/wp-graphql/wp-graphql/pull/2132
When querying a content model by
id
andidType
asSLUG
, the content model returnsnull
.To reproduce
null
responseExpected behavior
The response should include the post, as it would when using
idType
set toID
,DATABASE_ID
, etc.Screenshots
Version information