Hi there! I'm working on a PR on graphql-request. ...
# orm-help
b
Hi there! I'm working on a PR on graphql-request. Still WIP but I'd like a feedback to know if I'm doing something usefull? Here it is: https://github.com/prisma/graphql-request/pull/105
d
That is awesome, feel free to DM me.. we can coordinate and get this moving. Thanks for contributing 🙂
b
ok thanks
l will
I'll add gql tag example and link to TS sources
Also fragment example
d
Sounds awesome 🙂 One small request: Can you please change this async wrapper part of code: https://github.com/prisma/graphql-request/pull/105/files#diff-04c6e90faac2675aa89e2176d2eec7d8R83 With this
async function main
approach => https://www.prisma.io/docs/get-started/01-setting-up-prisma-new-database-a002/#read-and-write-data-using-the-prisma-client The idea the that the prior is a bit intimidating to developers who are new to JS and related concepts. Do you agree? 🙂
b
Ok no problem
👍 1
Ok but I have to export every main, at least un TS, because without it we would have many main on global and so TS error, am I c'est?
Clear*
d
In the PR at the moment, the async part is not exported? Why would you want that? Maybe I misunderstood something.
Even if it is exported, it is scoped by the package and can be aliased while importing but I don't get the requirement. Please explain more 🙂
b
I'll explain un PR layer :)
👍 1
@divyendu do you know an gql endpoint that sets a cookie for cookie example?
otherwise example sucks a bit
Does anyone knows a public endpoint that also return a 'set-cookie' header? (for writing an example code) 🤞
d
Not that I am aware of from the top of my head 🙂
b
Can you take a look at my PR, ready for review, I can give you an example for the required example...
ping @divyendu 😏
I'll start a new PR based on this one to add ts typings
d
Hey! sure.. I will take a look later today 🙂
b
thanks, can't wait to have your feedback
👍 1
I made 2 others PR following the 1st one https://github.com/prisma/graphql-request/pull/106 and https://github.com/prisma/graphql-request/pull/107, I can rebase once you ask me to clean diff with previous PR, thanks for your review 👍
👍 1
d
Hey! thanks for the awesome work.. I will take a look as soon as I can.. 🙂
b
Great, I've other things in mind like rename T to TData and add TVariables types, also accept DocumentNode (gql) and not just string as query param
👍 1
But do it once those are merged 😏
I also have a new PR for a long waiting bug https://github.com/prisma/graphql-request/pull/108
🙌 1
@divyendu I'm working on adding TVariables, and do you think changing TResult from "any" to "unknown" is doable?
I think this is great but could be kind of a breaking change for TS user
for lazy TS users
d
Any breaking changes will more discussion, I would suggest documenting the change in form of an issue and then we can discuss over there publicly and decide on it 🙂
👍 1
b
@divyendu What do you think about supporting both string and gql tag as query param?
d
We have gone on that road once, had to revert - for context - https://github.com/prisma/graphql-request/pull/92
b
A usage doc in README.md then should be enough 🙂
👍 1