-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Work on using external modules #158
base: main
Are you sure you want to change the base?
Changes from all commits
a995481
69bba95
8a1fa3b
a431599
d9acd95
08a8573
da25562
f312118
58fedca
fda55a0
1b801c5
f889bfd
78cb2c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- [x] SDL should extend type for external types - I guess marking types in SDL | ||
- [x] can't generate graphql-js stuff, don't want to do it for externs - don't support graphql-js for this? | ||
- [x] all imported types (so support interfaces etc) | ||
- [x] Read SDL to actually do validation | ||
- [x] reenable global validations | ||
- [x] "modular" mode? like no full schema, but parts of schema but with full validation by resolving it? | ||
- [?] treat query/mutation/subscription as "import" type and extend it | ||
- [ ] all tests to add fixtures for metadata/resolver map | ||
- [ ] pluggable module resolution - too many variables there, use filepath by default, let users customize it | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In theory we only need this path in order to perform validation (is that right?). I wonder if there is a TypeScript API which will let us use the same (or most of) TypeScript's implementation of module resolution. I would need to avoid expecting the file to have a .js/.ts/.mjs/etc extension, but maybe something like that is exposed? I suspect that would be sufficient we could find something like that. I did see this: https://github.com/microsoft/TypeScript/blob/6a00bd2422ffa46c13ac8ff81d7b4b1157e60ba7/src/server/project.ts#L484 Which could be a good place to start looking. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure any non-ts files are included in how the typescript resolves it. There is also the whole story of "lib" in package.json and stuff like this. Ultimately there is no "well-known" spot for the GraphQL files, so it feels like it all might just break weirdly. I will experiment on this ofc, but I feel that there might not be an easy solution. |
||
- [ ] first try ts project resolution | ||
- [ ] how to handle overimporting? Improting whole SDL module "infects" the schema with types that might not be requested. | ||
- [ ] another check on error handling - I think eg enums and scalars accept stuff they shouldn't accept? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm onboard with this. Happy to have this as a separate PR if you want to merge that first.