Importing types, inputs, etc. using #import syntax
See original GitHub issueHi ✋
I want to use this package server side, to split my schema definition into multiple files.
Is it possible to use #import
for complete types, inputs, etc. ? Or is it only supposed to work with fragments?
Bar.graphql
type Bar {
name: String!
}
typeDefs.graphql
#import "./Bar.graphql"
type Query {
bar: Bar
}
schema {
query: Query
}
schema.js
import typeDefs from "./typeDefs.graphql";
I got this error
Error: Type "Bar" not found in document.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:12 (9 by maintainers)
Top Results From Across the Web
import - JavaScript - MDN Web Docs - Mozilla
In order to use the import declaration in a source file, the file must be interpreted by the runtime as a module. In...
Read more >Documentation - Modules - TypeScript
Prior to TypeScript 3.8, you can import a type using import . With TypeScript 3.8, you can import a type using the import...
Read more >How to Dynamically Import JavaScript with Import Maps
An import map is a JavaScript object where the key is the name of the import ( @lodash/startCase ) and the value is...
Read more >Import Statements in TypeScript: Which Syntax to Use
TypeScript has multiple syntaxes for imports. When should you use which? It depends. In this blog, Jessica Kerr shares her thoughts, ...
Read more >type-only imports — A new TypeScript feature that benefits ...
You've decided you're going to use Babel and write your source in TypeScript. But what happens when you're sharing TS types across module ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yvele I’ve decided to go ahead and implement this feature. It’s going to take a day or two because:
#import
logic is tightly coupled with the non-schema file logic right now.But I am working on it and will let you know as soon as I publish the new version!
I found I pushed PR #42 with fix + tests
Thanks @detrohutt