hasura / hasura/graphql-engine
Optional chaining in query parameters for rest connectors
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Discussed in https://github.com/hasura/graphql-engine/discussions/9130
Originally posted by **nehalicious** October 19, 2022
https://hasura.io/docs/latest/api-reference/kriti-templating/#kriti-optional-chaining
Hey, I'm trying to configure a rest connector to use optional chaining for query parameters. Essentially something like this:
```foo: '{{$body.input?.foo}}'```
However, when i try to save this, I see an error saying
```"LexError: Invalid Lexeme: '?}}\"'"```
does anyone know what could be going wrong? If I look at the documentation, this seems like it should be fairly straighforward https://hasura.io/docs/latest/api-reference/kriti-templating/#kriti-optional-chaining
Contributor guide
Research direction
Start by reproducing the REST connector query-parameter configuration from the issue and trace the Kriti templating entry point that raises the LexError. Check the optional-chaining documentation linked in the report; done means the expression is accepted and produces the expected query parameter without the lexer error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100