Remote schema type prefix/suffix should be removed when the request is forwarded to the remote schema
See original GitHub issueVersion 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
Issue Analytics
- State:
- Created 10 months ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Remote Schema to Remote Schema relationships - Hasura
Step 1: Define and create the relationship. The following fields can be defined for a remote schema relationship: Name: Define a name for...
Read more >Permissions for Remote Schemas · Issue #2461 - GitHub
Hi @tirumaraiselvan,. One idea, that I think would be easier, is to let the Remote Schema generate different schemas, for each role.
Read more >Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >Remote GraphQL Schema Introspection Codegen - YouTube
Automatically introspect your stitched GraphQL schemas endpoints, and use the results to execute requests to remote schemas with the GraphQL ...
Read more >How to use mergeSchemas for remote schemas with Apollo ...
I have some problems with merging remote schemas. ... messages like "Cannot query field name on type Company because mergeSchemas only takes ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you folks for reporting this bug. This has been fixed now and the fix will be included in the next release.
I’ll open a different issue for the inlining problem.