question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remote schema type prefix/suffix should be removed when the request is forwarded to the remote schema

See original GitHub issue

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?

  1. Add a type prefix to a remote schema
  2. Execute a request using either an enum input variable, either directly or as part of another input type
  3. The remote schema rejects the request

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
codingkarthikcommented, Nov 24, 2022

Thank you folks for reporting this bug. This has been fixed now and the fix will be included in the next release.

0reactions
BenoitRanquecommented, Nov 29, 2022

I’ll open a different issue for the inlining problem.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found