-
-
Notifications
You must be signed in to change notification settings - Fork 51
[redux-saga-requests-graphql]Argument of type 'TemplateStringsArray' is not assignable to parameter of type 'string'. #309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you please show me full snippet here which breaks types? below https://github.com/klis87/redux-saga-requests/blob/master/packages/redux-saga-requests-graphql/types/index.d.spec.ts#L7 locally I added: gql(`
query{
obj {
id
}
}
`); and it works. I just wanna make sure that this is really needed. Then I will merge your PR. Thanks! |
Sry my bad, actually bracket is wrong here. I am not sure but probably this should be just Please confirm and adjust your PR or give me example when |
I tried this: gql`
query{
obj {
id ${'1'} ${2}
}
}
`; I believe the correct type is actually export const gql: (
query: TemplateStringsArray,
...args: (string | number)[]
) => string; As some people like to have dynamic queries, even though only static ones are officially recommended |
Sounds good ! I'll fix that |
Are regular strings passing the TemplateStringsArray type ? |
I think this wont be possible for gql, because gql function can actually be used only with template literals So gql`query` will work. |
Just merged. The only problem is that PR was to If you need this now, pls create PR to master directly |
@fhourdin merged in newest version |
Typescript seems to be crying when I try to use "gql" from "redux-saga-requests-graphql"
Can be resolved by adding "TemplateStringsArray" as a possible type for "gql" arguments.
Pull request in progress
btw, your lib rocks
The text was updated successfully, but these errors were encountered: