Giter Site home page Giter Site logo

Comments (3)

AlecAivazis avatar AlecAivazis commented on July 20, 2024 1

Hey @SorenHolstHansen - thanks for opening this up. Let me try to unpack it a bit.

One of the key designs in houdini is that related stuff should be colocated with your component. When query documents are split up from their components, users are naturally encouraged to think about their queries being shared in ways that aren't tied to their component hierarchy. In my experience (primarily with Relay) it's very important to keep things compartmentalized. When codebases get large, the constant bouncing back and forth between different files can be tiresome. It Also, I'm not sure I understand the difference between adding your query body in a separate .gql file vs your component body. As long as queries and fragments stay focused they shouldn't get large enough to warrant the extra file, imo.

Probably worth mentioning that you can use the --pull-schema or just -p in order to pull down the most recent schema before generating. This means that you really only have to ever define the schema on the server as the source of truth, and then use it in your component

from houdini.

SorenHolstHansen avatar SorenHolstHansen commented on July 20, 2024

Cool, I didn't know about the --pull-schema option, definitely makes it a lot nicer.

from houdini.

ohmree avatar ohmree commented on July 20, 2024

Also, I'm not sure I understand the difference between adding your query body in a separate .gql file vs your component body. As long as queries and fragments stay focused they shouldn't get large enough to warrant the extra file, imo.

One such difference is syntax highlighting - the graphql snippet in the sample from the readme isn't highlighted for me in emacs with web-mode and adding support would be a pain.

Also I haven't checked this, but if svelte's language tools don't integrate with tsserver plugins such as ts-graphql-plugin then intellisense is another issue that would be solved by allowing graphql in separate files.

EDIT: seems like this might've been fixed in web-mode, I'm just trying to figure out how to enable it and/or if it's sufficient for me.
Still, this could all be avoided if I could just use the standard tooling for graphql files (which would require houdini to support separate .gql files).
EDIT 2: yeah I don't think the fix for the aforementioned issue does anything to syntax highlighting.
So the only way I could use houdini with reasonable DX would be if support for separate .gql files was added.

from houdini.

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.