Graphql-engine: variable used in position expecting type _text

Created on 1 Sep 2019  路  2Comments  路  Source: hasura/graphql-engine

following up with this issue https://github.com/hasura/graphql-engine/issues/1170

How can I include variables in mutations when the field type in the database is an array?

GraphQL

mutation insert($words: String!){
  insert_words(objects: {list: $words}) {
    returning {
       list
    }
  }
}

Query Variables

{
    "words": "{hello, world}"
}

I get the following error:

Variable $words of type String! used in position expecting type _text

question

Most helpful comment

@chrisjaimes The error is pretty self-explanatory :smile: , change String! to _text!

All 2 comments

@chrisjaimes The error is pretty self-explanatory :smile: , change String! to _text!

@shahidhk thanks! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EmrysMyrddin picture EmrysMyrddin  路  3Comments

leoalves picture leoalves  路  3Comments

revskill10 picture revskill10  路  3Comments

hooopo picture hooopo  路  3Comments

sachaarbonel picture sachaarbonel  路  3Comments