Comments (3)
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.
Cool, I didn't know about the --pull-schema option, definitely makes it a lot nicer.
from houdini.
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)
- export type * from causes Unexpected token HOT 3
- Support no-cache fetch policy HOT 1
- Defer query support HOT 1
- Monorepo requires local @sveltejs/kit dependency
- Use GraphQL field descriptions to generate JSDoc comments on `$result` types HOT 3
- Houdini fails to load data on initial query HOT 2
- Support the using keyword (explicit resource management)
- List insert mutation with a `@with` param doesn't update the list
- Houdini-svelte crashes the svelte LSP in vscode
- Memory leak in error path HOT 2
- [Cache] Automatically trigger refetches of modified values HOT 1
- List operations with hop to parent HOT 1
- loadAll, lazy initClient and iOS / WebKit bug resulting in Error 500 HOT 1
- Add configurable timeout for pullSchema
- Align Result and QueryResult HOT 4
- Circular dependencies in $houdini folder HOT 1
- List operations (append and update) from subscriptions does not work if the root type is a union HOT 1
- Doesn't work with vite 5.3 HOT 11
- Setting a custom node interface ID field to support Supabase's Graphql ? HOT 2
- QueryNameVariables type enforces runtime scalars to be present in the return value when they are not required
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 houdini.