Comments (2)
I agree "adding more complex tag pattern" .
Because some GraphQL clients don't use template literal tag function.
For example, with octokit/graphql.js
:
const { repository } = await graphql(
`
{
repository(owner: "octokit", name: "graphql.js") {
issues(last: 3) {
edges {
node {
title
}
}
}
}
}
`,
{
headers: {
authorization: `token secret123`,
},
}
);
But I will not care TypeScript Template Literal Types pattern (e.g. Query<"query { data }">
).
But I will not use this in my plugin because I think lexing / parsing queries should be responsible for graphql-js . And recursive descent parser with string type literal can exceed TypeScript's recursive type limitation.
from ts-graphql-plugin.
@Quramy about
But I will not care TypeScript Template Literal Types pattern (e.g. Query<"query { data }"> ).
I don't mean to actually infer type or whatever, just when you specify the pattern do not ignore ts types if they are matched by the pattern. I.e. here type Data = Query<'query { data }'>
there is no some predefined Query
type that cause some special behavior of ts-graphql-plugin
. So as i understand the task of the plugin is match part of the file text, parse it as GraphQL and provide autocomplete.
So yes, i agree that this plugin should not provide some types inference out of the box, but delegate it to some other third party libraries. However, it would be good to have autocomplete in such cases
from ts-graphql-plugin.
Related Issues (20)
- "No GraphQL schema" error (GitHub API)
- Document how to import graphql files (`typed-query-document`)
- Examine the possibility to use type from queries without generation HOT 6
- ts-graphql-plugin does not understand directive @connection (relay) HOT 3
- [typegen] Nullable params should be optional HOT 2
- List of list support HOT 2
- ts-graphql-plugin v4
- Empty variables, consider using `never` type? HOT 2
- Allow to customize type generation
- RangeError: Maximum call stack size exceeded HOT 3
- Action Required: Fix Renovate Configuration
- Feature Request: Cleanup generated files HOT 1
- External/Global fragment sources HOT 3
- cli extract can't identify fragment which export by default.
- Dependency Dashboard
- graphql rename causes problems for webpack parser (Error: Cannot find module 'graphql/validation/rules/ExecutableDefinitions') HOT 3
- Typescript 4.8.2 breaking changes HOT 2
- Ignore/disable/turn off rules (for a certain line?)
- should depend on/use graphql-language-service instead of graphql-language-service-interface (deprecated) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-graphql-plugin.