-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create e2e project * init houdini * use env var for token * update lock * update * accept liveQuery handler as 3rd argument for now * clean up deprecation warnings * persist live flag in artifact * add live to artifact type * add liveQuery to store * close EventSource when unsubscribing * liveQueryHandler takes an updater instead of just returning a raw value * use third party apply_patch for grafbase test * pass session to LiveQueryHandler * remove logs * handle errors * start document observer * failing test and start store implementation * fixed all tests except lists * all tests pass * map subs to spec in one place * update snapshots * remove live from artifact * another failing test * first pass at middleware iterator * remove unused import * temporary names for phases * fix error when invoking first terminate * tweak docs * exception handling * cleanup phase * tweak * move client logic to special directory * add skeleton for rest of middlewares * fetch gives full payload * rename file * rename document observer stages ; track loading state * naming tweaks * naming and comments * plugins can specify client plugins * passing null to client_plugins prevents function invocation * accept url and fetchParams functions * users can't provide plugins and pipelines together * rework fetch plugin * start implementating plugins * implement input and mutation plugin ; fix fetching state tracking * update tests * random tidyness * failing test * query plugin includes last used variables in outbound requests * update variables before subscribing in query * move variable tracking into document observer * marshalVariables and variablesChanged from handlers * can check if variables changed right after assigning it * mutation clears layer if there is a network error * quietErrors happens at the network level now * first pass at subscriptions * typos * tests pass * tidy up type names * strengthen test * clean up typedefs * improved idempotency * rename plugin.error to plugin.throw * query plugin uses marshaled variables * start implementation query store * implement query, subscription, and mutation * query pagination * unused imports * make import logic synchronous * everything builds!! * fix import tests * move injected plugins into plugins directory * use getCurrentClient in houdini-react * fix imports * subscribe on the way out * better hook wrapping * update snapshot * test cache policy * add loading state checks to tests * dont specify pipeline on client * remove App.Sessions * query pagination works! * fix component queries * more tests passing * fix fragment cursor pagination * fragment offset and metadata tests * mutation initial state * more tests * fixed more tests * remove logging * ⚡ UPDATE: App Metadata & Session * 🚀 UPDATE: libReporter config * update snapshots * move client retrieval into houdini-svelte * plugin client_plugins can be specified as a function of config file and plugin config * add throwOnError config * can update store state from handle * setup test * flatten client plugin hook names * update init and release notes * update documentPlugin wrapper for new keywords * update release notes and subscription setup * remove index from doc frontmatter * add doc page for client * flesh out client docs more * @manual_load directive & fetching default. (#831) * ✨ NEW: info in artifact * ✨ NEW: default init value * 🐛 FIX: the test to be coherent! * ✏️ UPDATE: changeset * 🐛 FIX: lint * ⚡ IMPROVE: serializeValue to have keys quoted * ✨ NEW: artifact.pluginsData * 🚧 UPDATE: all artifacts + check 1 test + docs to doc * 🐛 FIX: defautl default is false * 👌 FIX: lint * 🚸 UPDATE: having the right default for core and the right tests for core * 💡 IMPROVE: with libReporter (to comment if any config change) * 👌 FIX: lint * 👌 FIX: linting * start on client plugin section * flesh out plugin overview * start on your first plugin * add second plugin example * add type definition to plugin docs * add enter and exit phase sections * more doc updates * pull out data sources section * reorder subsections * add beforeNetwork phase * tweak sizing and spacing of diagram * note change of quietQueryErrors in release notes * add $houdini/plugins export * add section on Choosing a Phase * update example * subscription handler is now a function of the ClientPlugin context * add changeset * remove unused import * linter * more type imports * make sure that the plugin root directory exists * fix graphql return type generator * enter prerelease mode * start from 1.0.0-next.1 to cover last mistake * 🎨 UPDATE: zoomable component (first use: Workflow) * ✏️ FIX: link & mini typo * 🎨 IMPROVE: colors * feedback * remove grafbase e2e test * move pipeline config to deep dive * comment tweak * grammar * add links to source of truth for typedefs * start on fetchParams specifying body * fetchParams can specify body * update automatic persisted queries * better comments * document App.Stuff * tweak comment * detect spread values * rename file * remove unused config value * add fragments to home page * remove test * rename DocumentObserver to DocumentStore * better subscription auth logic * client-plugin review * add typedefs for throwOnError and fetchParams * tweak words * punctuation * fix build errors * start single step document store * forgot to commit something * fix document store * add test for error throw * remove log * consolidate error handling * update docs * remove log * fix build errors * choosing a phase after enter vs exit * wether -> whether * punctuation * small tweaks * more tweaks * add caption * one word Co-authored-by: jycouet <[email protected]>
- Loading branch information
1 parent
8afdc19
commit 7e2977f
Showing
237 changed files
with
9,813 additions
and
4,690 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'houdini': major | ||
'houdini-svelte': major | ||
--- | ||
|
||
Implemented new ClientPlugin architecture for HoudiniClient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'houdini': patch | ||
--- | ||
|
||
in queries when we have manual_load directive fetching is false by default otherwise true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,30 @@ | ||
import type { RequestHandler } from '$houdini'; | ||
import { HoudiniClient } from '$houdini'; | ||
import { HoudiniClient, type ClientPlugin } from '$houdini'; | ||
import { error } from '@sveltejs/kit'; | ||
|
||
// For Query & Mutation | ||
const requestHandler: RequestHandler = async ({ | ||
fetch, | ||
text = '', | ||
variables = {}, | ||
metadata, | ||
session | ||
}) => { | ||
// Prepare the request | ||
const url = 'http://localhost:4000/graphql'; | ||
// in order to verify that we send metadata, we need something that will log the metadata after | ||
const logMetadata: ClientPlugin = () => ({ | ||
end(ctx, { resolve, value }) { | ||
if (ctx.metadata?.logResult === true) { | ||
console.info(JSON.stringify(value)); | ||
} | ||
|
||
// regular fetch (Server & Client) | ||
const result = await fetch(url, { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Authorization: `Bearer ${session?.user?.token}` // session usage example | ||
}, | ||
body: JSON.stringify({ | ||
query: text, | ||
variables | ||
}) | ||
}); | ||
|
||
// return the result as a JSON object to Houdini | ||
const json = await result.json(); | ||
|
||
// metadata usage example | ||
if (metadata?.logResult === true) { | ||
console.info(JSON.stringify(json)); | ||
resolve(ctx); | ||
} | ||
|
||
return json; | ||
}; | ||
}); | ||
|
||
// Export the Houdini client | ||
export default new HoudiniClient(requestHandler); | ||
export default new HoudiniClient({ | ||
url: 'http://localhost:4000/graphql', | ||
fetchParams({ session }) { | ||
return { | ||
headers: { | ||
Authorization: `Bearer ${session?.user?.token}` // session usage example | ||
} | ||
}; | ||
}, | ||
throwOnError: { | ||
operations: ['all'], | ||
error: (errors) => error(500, errors.map((error) => error.message).join('. ') + '.') | ||
}, | ||
plugins: [logMetadata] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,14 @@ | ||
import { browser } from '$app/environment' | ||
import type { RequestHandlerArgs, SubscriptionHandler } from '$houdini' | ||
import { HoudiniClient } from '$houdini' | ||
import { subscriptionPlugin } from '$houdini/plugins' | ||
import { createClient as createWSClient } from 'graphql-ws' | ||
|
||
// For Query & Mutation | ||
async function fetchQuery({ fetch, text = '', variables = {} }: RequestHandlerArgs) { | ||
const result = await fetch('http://localhost:4000/graphql', { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
body: JSON.stringify({ | ||
query: text, | ||
variables, | ||
}), | ||
}) | ||
|
||
return await result.json() | ||
} | ||
|
||
// For subscription (client only) | ||
let socketClient: SubscriptionHandler | null = null | ||
if (browser) { | ||
// @ts-ignore | ||
socketClient = createWSClient({ | ||
url: 'ws://localhost:4000/graphql', | ||
}) | ||
} | ||
|
||
// Export the Houdini client | ||
export default new HoudiniClient(fetchQuery, socketClient) | ||
export default new HoudiniClient({ | ||
url: 'http://localhost:4000/graphql', | ||
plugins: [ | ||
subscriptionPlugin(() => | ||
createWSClient({ | ||
url: 'ws://localhost:4000/graphql', | ||
}) | ||
), | ||
], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/houdini-plugin-svelte-global-stores/src/plugin/codegen/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/houdini-plugin-svelte-global-stores/src/plugin/codegen/stores/fragment.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/houdini-plugin-svelte-global-stores/src/plugin/codegen/stores/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/houdini-plugin-svelte-global-stores/src/plugin/codegen/stores/mutation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/houdini-plugin-svelte-global-stores/src/plugin/codegen/stores/query.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/houdini-plugin-svelte-global-stores/src/plugin/codegen/stores/subscription.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/houdini-plugin-svelte-global-stores/src/plugin/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
packages/houdini-plugin-svelte-global-stores/src/plugin/kit.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.