Comments (3)
Its definitely something that I would love to see in houdini
, just forgot to create the issue 😅
from houdini.
Thinking about this some more, we could probably use a relay like approach where we create a output file queryMap.json
customizable with an cli flag e.g. --persist-output ./src/some_folder/queryMap.json
with the artifact hash as key
and the query as value
. We could then pass the artifact or some form to the environments fetchFunction instead of only text
and variables
. From there some could simply pass documentId
(the artifact hash) instead of the full query.
export default new Environment(async function (operation) {
// send the request to the api
const result = await this.fetch('/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
// query: operation.text,
variables: operation.variables,
documentId: operation.hash
}),
})
// parse the result as json
return await result.json()
})
We could then probably set the raw field in generated artifacts to null
if we're persisting queries, but i'm not sure.
- Where are queries getting hashed? hashDocument doesn't seem to be used.
from houdini.
Awesome - in general the approach seems like the right one. I think it's probably more likely that the user is going to follow the standard that urql and apollo both follow which can be found here but I don't think that really matters from our perspective. As long as a hash gets generated and attached to the artifact in a way that the environment has access to when making queries, the user can make that decision for themselves.
Also, hashDocument
isn't used any more but I left it in the codebase in case we needed it. It's a remnant from when the preprocessor import the artifacts but that's no longer the case.
from houdini.
Related Issues (20)
- 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 7
- List operations (append and update) from subscriptions does not work if the root type is a union HOT 2
- 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 HOT 1
- SvelteKit: Fragment stores become empty after hydration when using +page.server.ts server-side loading alongside +layout.gql HOT 5
- Unmarshalling lists of scalars not working HOT 2
- Could not find required variable function HOT 2
- Houdini vite plugin makes the svelte lsp crash HOT 11
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.