question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for graphql string literal

See original GitHub issue

I want to be able to use the use gql tag template literal with fragment embedding as I find that format to be easier to read and write. I am not sure how separate .graphql files are technically different to string literal format. Is it that it adds a package to parse the query to AST at runtime? If that is true then can we integrate a static compiler that does that for me during build-time? https://github.com/firede/ts-transform-graphql-tag

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pranaypratyushcommented, Jul 25, 2020

Will do sir. Gonna use it in a new project I am heading. Thanks for your work.

1reaction
piglovesyoucommented, Jul 25, 2020

I pushed graphql-let@canary, containing Babel Plugin support allowing you to get typed graphql-codegen results from inline GraphQL documents. Please drop a comment before merging it if you notice something.

https://github.com/piglovesyou/graphql-let/tree/pr-gql-tag#experimental-feature-babel-plugin-for-inline-graphql-documents

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I represent a string enum (string literal union) in ...
I have a short list of string literals which I would like to have represented in my GraphQl definition. I tried using enum,...
Read more >
Support for string literal comments · Issue #21 - GitHub
The gql tagged template literal is available as an export in just about every top-level apollo package, so it's pretty widely used.
Read more >
Schemas and Types - GraphQL
String is one of the built-in scalar types - these are types that resolve to a single scalar object, and can't have sub-selections...
Read more >
GraphQL schema basics - Apollo GraphQL Docs
GraphQL's schema definition language (SDL) supports Markdown-enabled documentation strings, called descriptions. These help consumers of your graph discover ...
Read more >
Why do GQL strings need to be put through the gql function in ...
A place for interesting and informative GraphQL content and ... Because it's not valid JavaScript it goes into a string literal.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found