Server Version: v2.0.8
CLI Version (for CLI related issue): v2.0.3
Environment
What is the expected behaviour?
When my remote schemas contains enums and I need to apply permissions to them, the standard format without newlines should apply, or the engine should properly parse out newlines
Keywords
What is the current behaviour?
One of my remote schemas contains an enum of strings, and I have custom permissions for different users on accessing these fields. However, having enums causes the console to use line breaks between the strings, and the next time I start the engine I receive a remote schema parsing error.
My workaround has been to remove all lines breaks from the metadata and make the entire permission one line. However, if I modify one permission or sometimes modify another permission in the console. it will cause the metadata to restore the default format with the newlines, and I have to keep repeating the cycle.
I can confirm that when I delete the enum fields from my remote schema and reload the metadata, the console creates a format without newlines that is recognized by the engine.
I feel like this is a very easy fix but I don't know Haskell 😅.
I'm using TypeGraphQL to make my remote schemas.
How to reproduce the issue?
Create a remote schema with enum string fields.
From the console, apply remote schema permissions to all fields including the enum
Restart the engine, or apply metadata again.
Workarounds:
Remove all newlines from remote schema permission and format the entire string into one line
Remove enum fields, apply new permissions and reload metadata.
Screenshots or Screencast
Remote schema metadata with newlines
Please provide any traces or logs that could help here.
Stack trace when starting engine (using hasura/graphql-engine:v2.0.8.cli-migrations-v3)
Version Information
Server Version: v2.0.8 CLI Version (for CLI related issue): v2.0.3
Environment
What is the expected behaviour?
When my remote schemas contains enums and I need to apply permissions to them, the standard format without newlines should apply, or the engine should properly parse out newlines
Keywords
What is the current behaviour?
One of my remote schemas contains an enum of strings, and I have custom permissions for different users on accessing these fields. However, having enums causes the console to use line breaks between the strings, and the next time I start the engine I receive a remote schema parsing error.
My workaround has been to remove all lines breaks from the metadata and make the entire permission one line. However, if I modify one permission or sometimes modify another permission in the console. it will cause the metadata to restore the default format with the newlines, and I have to keep repeating the cycle.
I can confirm that when I delete the enum fields from my remote schema and reload the metadata, the console creates a format without newlines that is recognized by the engine.
I feel like this is a very easy fix but I don't know Haskell 😅.
I'm using TypeGraphQL to make my remote schemas.
How to reproduce the issue?
Workarounds:
Screenshots or Screencast
Remote schema metadata with newlines
Please provide any traces or logs that could help here.
Stack trace when starting engine (using hasura/graphql-engine:v2.0.8.cli-migrations-v3)
time="2021-09-17T16:25:22Z" level=fatal msg="error applying metadata \n{\n \"path\": \"$.args.metadata.remote_schemas[1].permissions[1].definition.schema\",\n \"error\": \"parsing the schema document: \\\"endOfInput\\\"\",\n \"code\": \"parse-failed\"\n}"
Any possible solutions?
Can you identify the location in the source code where the problem exists?
If the bug is confirmed, would you be willing to submit a PR?