-
Notifications
You must be signed in to change notification settings - Fork 468
Querying for preview via asPreview argument doesn't work when querying by slug, uri idTypes #1673
Copy link
Copy link
Closed
Labels
component: model layerRelating to the Model LayerRelating to the Model Layercomponent: queryRelating to GraphQL QueriesRelating to GraphQL Queriesobject type: postRelating to the Post Object TypesRelating to the Post Object Typesstatus: actionableReady for work to beginReady for work to begintype: bugIssue that causes incorrect or unexpected behaviorIssue that causes incorrect or unexpected behavior
Description
According to the switch statement at https://github.com/wp-graphql/wp-graphql/blob/develop/src/Type/Object/RootQuery.php#L503, when querying a post preview via slug or uri, the resolver functions return early before checking the asPreview parameter and returning the revision.
This seems like it would be considered a bug because I would expect the same behavior regardless of which IdType is being used, also because I don't see any documentation that specifically explains why this would be intentional.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component: model layerRelating to the Model LayerRelating to the Model Layercomponent: queryRelating to GraphQL QueriesRelating to GraphQL Queriesobject type: postRelating to the Post Object TypesRelating to the Post Object Typesstatus: actionableReady for work to beginReady for work to begintype: bugIssue that causes incorrect or unexpected behaviorIssue that causes incorrect or unexpected behavior
Type
Projects
Status
✅ Done