It would be more concise to take these non-optional parameters as arguments: jraph(url, query[, {...options}]):
jraph("https://csb-xpwq1o2824-xravvsjkul.now.sh/graphql",`query{
items{
title
}
}`)
But, I feel like taking (url)(query) would be more ergonomic, for reuse:
constgraphql=jraph("https://csb-xpwq1o2824-xravvsjkul.now.sh/")constres1=graphql(`query{
items{
title
}
}`)constres2=graphql(`query{
🅱tems{
title
}
}`)
It would be more concise to take these non-optional parameters as arguments:
jraph(url, query[, {...options}])
:But, I feel like taking
(url)(query)
would be more ergonomic, for reuse:Maybe return a Template Tag?
That’s actually exactly what I was planning to do. I’m glad i got some positive feedback on that kind of syntax. I’ll publish the new syntax tomorrow!