Skip to content

NodeByUri not resolving properly for media items #2178

@jasonbahl

Description

@jasonbahl

When using the path to a media item in a nodeByUri query, I get a null response.

This isn't happening on every environment I've tested, so it might be permalink related, but I cat replicate here:

Media Item Url:

http://wpgraphql-content.flywheelstaging.com/docs/debugging/screen-shot-2020-11-22-at-7-50-12-am/

Query for said url

returns null

Screen Shot 2021-12-14 at 11 24 30 AM


Works on my machine!

This behavior works on my local setup:

Here's an image visited directly:

Screen Shot 2021-12-14 at 12 39 10 PM

And the same image queried by uri in GraphQL:

Screen Shot 2021-12-14 at 12 40 09 PM


Theories:

I would guess that this could have to do with a permalink setting. I've not compared my permalink rules across environments yet.

Another thing might be the model layer. It's possible that the Model Layer might be preventing the images from returning in some environments?

Not quite sure the root of the issue and still need to understand the exact steps to reproduce since I'm getting different behavior in different environments.

Metadata

Metadata

Assignees

Labels

component: queryRelating to GraphQL Queriesnot staleShort-circuits stalebot. USE SPARINGLYobject type: mediaRelating to the MediaItem Typestatus: actionableReady for work to begintype: bugIssue that causes incorrect or unexpected behavior

Type

No type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions