Replies: 2 comments 2 replies
-
The GraphQL spec does not have support for in-line string concatenation, which is what you're showing here. But what you can do instead is concat the strings yourself before passing them to your client of choice. In javascript this could look like this: const nameToSearch = '' // string from user input
const query = `query SearchUsers($name: String!) { users(where: { name: { _like: $name } }) { id name email } }`
const variables = { name: `%${nameToSearch}%` }
const response = await executeGraphQL(query, variables) |
Beta Was this translation helpful? Give feedback.
2 replies
-
I am aware of this Benoit. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to do something like below with Hasura
query SearchUsers($name: String!) { users(where: { name: { _like: "%" + $name + "%" } }) { id name email } }
I am getting Cannot parse unexpected character "+" . Is this something possible ?
Beta Was this translation helpful? Give feedback.
All reactions