Graphql-engine: Default value does not accept HTTP URL (Postgres error)

Created on 11 Apr 2020  路  6Comments  路  Source: hasura/graphql-engine

Hello,

I tried to add a default value in Hasura as an URL but Postgres threw an error:

image

I guess that the URL should be between quote in this query because Postgres does not like the charactere :. :)

I do not have the knowledge of your project to know where to edit this and if it is the good way to fix that.

Thank you for your awesome work ! :)

console quickfix bug

All 6 comments

@Tchoupinax I attempted to do this for a column of type text and it seems to work. Can you confirm the type of the imageUrl column in your schema

@rikinsk Hello, my column is typed as character varying.
What is it the problem with that ? I can change but i would like to understand. ^^

Is varchar a bad practice to store URL or other string ?

@Tchoupinax No no. I was just querying to help debug the issue. This is definitely a bug.

Great. Tell me if you need other information. ;)

Till this is fixed, a workaround would be to surround the default values with single-quotes. eg. '<value>'

Yeah, to continue my work i performed manually the query with quote as you suggested and now it works.
For details, Hasura shows this:

image

Was this page helpful?
0 / 5 - 0 ratings