houdini icon indicating copy to clipboard operation
houdini copied to clipboard

Infer inline query variables from route parameters

Open AlecAivazis opened this issue 3 years ago • 2 comments

If a route's path contains parameters that match a query's variables, the user shouldn't have to define a variable function if its just going to do ({params}) => params.

Questions:

  • How do we handle massaging custom scalars?

AlecAivazis avatar Jul 06 '22 06:07 AlecAivazis

/foo/[id=MyCustomScalar] could automatically match and unmarshal for the variables

AlecAivazis avatar Aug 09 '22 20:08 AlecAivazis

I would love to have queryParam as well. /foo?pageSize=20

I was thinking that we know that pageSize is an Int in the schema, so we don't need to specify the scalar. No? Either the unmarshal works either we throw?

/foo?startFrom=2000-01-01T00:00:00.000Z

jycouet avatar Aug 23 '22 00:08 jycouet