Git Product home page Git Product logo

Comments (4)

mishushakov avatar mishushakov commented on August 25, 2024

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.

mishushakov avatar mishushakov commented on August 25, 2024

Btw. Can I ask what other framework, if any you're using with your current approach?

from garph.

JoviDeCroock avatar JoviDeCroock commented on August 25, 2024

I managed to pull it off with pothos by doing addQueryField 😅 missing the inferClientTypes though

from garph.

mishushakov avatar mishushakov commented on August 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.