-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
k/bugSomething isn't workingSomething isn't workingp/highcandidate for being included in the upcoming sprintcandidate for being included in the upcoming sprintt/gql-services
Description
Version Information
Server Version: 2.14.0
Environment
What is the current behaviour?
To avoid type conflicts with remote schema, hasura allows the user to set type prefixes and suffixes.
This effectively namespaces the types and prevents conflicts.
Hasura maps variables to scalar or JSON values when proxied to remote schemas.
However, this mapping does not happen if the request includes enums.
This is an issue as the remote schema will not be able to process the query.
Given this schema:
enum TodoTypeEnum {
work,
rest
}
type Todo {
description: String
type: TodoTypeEnum
}
query {
todo_by_type(type: TodoTypeEnum): Todo
}And the following query:
query GetTodoByType ($todoType: TodoTypeEnum) {
todo_by_type(type: $todoType) {
type
description
}
}Adding the type prefix remote_ will result in the following query being sent to the remote schema:
query GetTodoByType ($todoType: remote_TodoTypeEnum) {
todo_by_type(type: $todoType) {
type
description
}
}The remote schema does not have a type remote_TodoTypeEnum, so the request is rejected.
What is the expected behaviour?
Hasura should remove prefixes as it forwards the request to the remote schema.
How to reproduce the issue?
- Add a type prefix to a remote schema
- Execute a request using either an enum input variable, either directly or as part of another input type
- The remote schema rejects the request
zachequizachequi
Metadata
Metadata
Assignees
Labels
k/bugSomething isn't workingSomething isn't workingp/highcandidate for being included in the upcoming sprintcandidate for being included in the upcoming sprintt/gql-services