Comments (4)
Thank you so much for the kind words!
It's not really possible to extend a type from a different file. Type definitions can't really be "updated" in TypeScript. The way this is done currently is by returning a modified class.
Basically you will end up with two variants of the same root type.
We can make the type extendable in the same file (just like the implements
modifier). You will still have to import the types from elsewhere into the main file though, if you want the changes to be available globally. Pothos has a similar issue, so there's no way around it as it's a TypeScript limitation 🤷
from garph.
Btw. Can I ask what other framework, if any you're using with your current approach?
from garph.
I managed to pull it off with pothos by doing addQueryField 😅 missing the inferClientTypes though
from garph.
I have added an experimental extend
modifier in 0.6.3.
More: https://garph.dev/docs/guide/schemas.html#extend
from garph.
Related Issues (20)
- Dedicated support for loaders HOT 9
- Input type should be able to specify a default value
- Automatic Filters HOT 1
- Automatic Pagination HOT 1
- Implementation-first API
- Semantics
- Drizzle Integration HOT 6
- Add auth examples
- Organizing complex projects
- Using garph's inbuilt relay schema builder types results in type errors. HOT 1
- g.scalar does not support optional() HOT 6
- Type inference issues when organizing resolvers in separate files HOT 2
- Name collisions can result in somewhat obscure errors
- Support for self referential types HOT 2
- Augment resolved types with internal properties HOT 14
- how to insert more field after accrss paginatedList() HOT 1
- Make builtin types lazy HOT 2
- Inferred types for subscriptions is incorrect
- inputType type reference not work well (can only resolved with scalar type) HOT 3
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 garph.