Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure programatic cache api #841

Merged
merged 45 commits into from
Jan 24, 2023
Merged

Restructure programatic cache api #841

merged 45 commits into from
Jan 24, 2023

Conversation

AlecAivazis
Copy link
Collaborator

@AlecAivazis AlecAivazis commented Jan 22, 2023

This PR replaces the get and set methods in the imperative API with read and write which both take fragments:

const user = cache.get('User', { id: 2 })

const data = user.read({
    fragment: graphql(`
        fragment UserReadInfo on User { 
            firstName
        }
    `)
})

user.write({
    fragment: graphql(`
        fragment UserWriteInfo on User { 
            firstName
        }
    `),
    data: { 
        firstName: "Another Name"
    }
})

While this is significantly more verbose than the previous api, there is no more of that cache.setFieldType complexity. the fragment contains all of the information we need to perform the write in a way that supports code splitting.

To help everyone out, please make sure your PR does the following:

  • Update the first line to point to the ticket that this PR fixes
  • Add a message that clearly describes the fix
  • If applicable, add a test that would fail without this fix
  • Make sure the unit and integration tests pass locally with pnpm run tests and cd integration && pnpm run tests
  • Includes a changeset if your fix affects the user with pnpm changeset

@changeset-bot
Copy link

changeset-bot bot commented Jan 22, 2023

🦋 Changeset detected

Latest commit: 14cd09f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
houdini-svelte Major
houdini Major
houdini-plugin-svelte-global-stores Major
houdini-react Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jan 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
docs ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 24, 2023 at 1:49AM (UTC)
docs-next ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 24, 2023 at 1:49AM (UTC)

@AlecAivazis AlecAivazis changed the title Write fragment Restructure programatic cache api Jan 22, 2023
@AlecAivazis AlecAivazis marked this pull request as draft January 22, 2023 07:56
@AlecAivazis AlecAivazis merged commit 55e750c into next Jan 24, 2023
@AlecAivazis AlecAivazis deleted the writeFragment branch January 24, 2023 01:51
AlecAivazis added a commit that referenced this pull request Jan 25, 2023
* enter prerelease mode

* HoudiniClient Plugins (#834)

* 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]>

* remove log

* 📦 v1.0.0-next.2 (next) (#838)

* 📦 v{VERSION} (next)

* fix changesets

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alec Aivazis <[email protected]>

* tidy up changelogs

* Restructure programatic cache api (#841)

* fragment stores need to provide an artifact

* first pass at Record.write

* unused import

* update snapshot

* list handlers work

* move FragmentValue utility type to types file

* changeset

* linter

* start on docs and add cache.read and cache.write

* nest fragment under fragment key when writing to records

* document cache.read and cache.write

* sketch out query type

* add query type definitions to CacheDef

* query variables in imperative type def

* generate query definitions

* unused imports

* unused import

* fixed tests

* fragment inputs are persisted in artifacts

* generate input type definitions and wire up variable marhsaling

* read and write variables with arguments

* update docs

* add links to fragment args docs

* replace @manual_load with @load

* changeset

* update docs

* update release notes

* update api welcome page cache section

* fix import type

* update tests

* typo in docs

* simpler second step

* soften second step

* cleanup

* cleanup cleanup

* graphql tag should return never in default case since that means the query wasn't recognized

* make imperative types more responsive when saving

* cleanup

* fix e2e test type

* e2e check

* grammar

* explicitly mention that manual_load is gone

* remove log

* Consolidate schema polling config (#842)

* move all schema polling things into config.watchSchema

* update docs

* fix documented watchSchema params

* update init command

* more doc updates

* clean up examples

* changeset

* 📦 v1.0.0-next.3 (next) (#843)

* 📦 v{VERSION} (next)

* tidy up changelogs

* more cleanup

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alec Aivazis <[email protected]>

* pass session to mutation

* changeset

Co-authored-by: jycouet <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
AlecAivazis added a commit that referenced this pull request Feb 10, 2023
* fragment stores need to provide an artifact

* first pass at Record.write

* unused import

* update snapshot

* list handlers work

* move FragmentValue utility type to types file

* changeset

* linter

* start on docs and add cache.read and cache.write

* nest fragment under fragment key when writing to records

* document cache.read and cache.write

* sketch out query type

* add query type definitions to CacheDef

* query variables in imperative type def

* generate query definitions

* unused imports

* unused import

* fixed tests

* fragment inputs are persisted in artifacts

* generate input type definitions and wire up variable marhsaling

* read and write variables with arguments

* update docs

* add links to fragment args docs

* replace @manual_load with @load

* changeset

* update docs

* update release notes

* update api welcome page cache section

* fix import type

* update tests

* typo in docs

* simpler second step

* soften second step

* cleanup

* cleanup cleanup

* graphql tag should return never in default case since that means the query wasn't recognized

* make imperative types more responsive when saving

* cleanup

* fix e2e test type

* e2e check

* grammar

* explicitly mention that manual_load is gone

* remove log
AlecAivazis added a commit that referenced this pull request Feb 10, 2023
* enter prerelease mode

* HoudiniClient Plugins (#834)

* 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]>

* remove log

* 📦 v1.0.0-next.2 (next) (#838)

* 📦 v{VERSION} (next)

* fix changesets

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alec Aivazis <[email protected]>

* tidy up changelogs

* Restructure programatic cache api (#841)

* fragment stores need to provide an artifact

* first pass at Record.write

* unused import

* update snapshot

* list handlers work

* move FragmentValue utility type to types file

* changeset

* linter

* start on docs and add cache.read and cache.write

* nest fragment under fragment key when writing to records

* document cache.read and cache.write

* sketch out query type

* add query type definitions to CacheDef

* query variables in imperative type def

* generate query definitions

* unused imports

* unused import

* fixed tests

* fragment inputs are persisted in artifacts

* generate input type definitions and wire up variable marhsaling

* read and write variables with arguments

* update docs

* add links to fragment args docs

* replace @manual_load with @load

* changeset

* update docs

* update release notes

* update api welcome page cache section

* fix import type

* update tests

* typo in docs

* simpler second step

* soften second step

* cleanup

* cleanup cleanup

* graphql tag should return never in default case since that means the query wasn't recognized

* make imperative types more responsive when saving

* cleanup

* fix e2e test type

* e2e check

* grammar

* explicitly mention that manual_load is gone

* remove log

* Consolidate schema polling config (#842)

* move all schema polling things into config.watchSchema

* update docs

* fix documented watchSchema params

* update init command

* more doc updates

* clean up examples

* changeset

* 📦 v1.0.0-next.3 (next) (#843)

* 📦 v{VERSION} (next)

* tidy up changelogs

* more cleanup

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alec Aivazis <[email protected]>

* pass session to mutation

* changeset

Co-authored-by: jycouet <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
AlecAivazis added a commit that referenced this pull request Feb 10, 2023
* fragment stores need to provide an artifact

* first pass at Record.write

* unused import

* update snapshot

* list handlers work

* move FragmentValue utility type to types file

* changeset

* linter

* start on docs and add cache.read and cache.write

* nest fragment under fragment key when writing to records

* document cache.read and cache.write

* sketch out query type

* add query type definitions to CacheDef

* query variables in imperative type def

* generate query definitions

* unused imports

* unused import

* fixed tests

* fragment inputs are persisted in artifacts

* generate input type definitions and wire up variable marhsaling

* read and write variables with arguments

* update docs

* add links to fragment args docs

* replace @manual_load with @load

* changeset

* update docs

* update release notes

* update api welcome page cache section

* fix import type

* update tests

* typo in docs

* simpler second step

* soften second step

* cleanup

* cleanup cleanup

* graphql tag should return never in default case since that means the query wasn't recognized

* make imperative types more responsive when saving

* cleanup

* fix e2e test type

* e2e check

* grammar

* explicitly mention that manual_load is gone

* remove log
AlecAivazis added a commit that referenced this pull request Feb 10, 2023
* enter prerelease mode

* HoudiniClient Plugins (#834)

* 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]>

* remove log

* 📦 v1.0.0-next.2 (next) (#838)

* 📦 v{VERSION} (next)

* fix changesets

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alec Aivazis <[email protected]>

* tidy up changelogs

* Restructure programatic cache api (#841)

* fragment stores need to provide an artifact

* first pass at Record.write

* unused import

* update snapshot

* list handlers work

* move FragmentValue utility type to types file

* changeset

* linter

* start on docs and add cache.read and cache.write

* nest fragment under fragment key when writing to records

* document cache.read and cache.write

* sketch out query type

* add query type definitions to CacheDef

* query variables in imperative type def

* generate query definitions

* unused imports

* unused import

* fixed tests

* fragment inputs are persisted in artifacts

* generate input type definitions and wire up variable marhsaling

* read and write variables with arguments

* update docs

* add links to fragment args docs

* replace @manual_load with @load

* changeset

* update docs

* update release notes

* update api welcome page cache section

* fix import type

* update tests

* typo in docs

* simpler second step

* soften second step

* cleanup

* cleanup cleanup

* graphql tag should return never in default case since that means the query wasn't recognized

* make imperative types more responsive when saving

* cleanup

* fix e2e test type

* e2e check

* grammar

* explicitly mention that manual_load is gone

* remove log

* Consolidate schema polling config (#842)

* move all schema polling things into config.watchSchema

* update docs

* fix documented watchSchema params

* update init command

* more doc updates

* clean up examples

* changeset

* 📦 v1.0.0-next.3 (next) (#843)

* 📦 v{VERSION} (next)

* tidy up changelogs

* more cleanup

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alec Aivazis <[email protected]>

* pass session to mutation

* changeset

Co-authored-by: jycouet <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@AlecAivazis AlecAivazis mentioned this pull request Feb 10, 2023
endigma pushed a commit to endigma/houdini that referenced this pull request Nov 10, 2024
* fragment stores need to provide an artifact

* first pass at Record.write

* unused import

* update snapshot

* list handlers work

* move FragmentValue utility type to types file

* changeset

* linter

* start on docs and add cache.read and cache.write

* nest fragment under fragment key when writing to records

* document cache.read and cache.write

* sketch out query type

* add query type definitions to CacheDef

* query variables in imperative type def

* generate query definitions

* unused imports

* unused import

* fixed tests

* fragment inputs are persisted in artifacts

* generate input type definitions and wire up variable marhsaling

* read and write variables with arguments

* update docs

* add links to fragment args docs

* replace @manual_load with @load

* changeset

* update docs

* update release notes

* update api welcome page cache section

* fix import type

* update tests

* typo in docs

* simpler second step

* soften second step

* cleanup

* cleanup cleanup

* graphql tag should return never in default case since that means the query wasn't recognized

* make imperative types more responsive when saving

* cleanup

* fix e2e test type

* e2e check

* grammar

* explicitly mention that manual_load is gone

* remove log
endigma pushed a commit to endigma/houdini that referenced this pull request Nov 10, 2024
* enter prerelease mode

* HoudiniClient Plugins (HoudiniGraphql#834)

* 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. (HoudiniGraphql#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]>

* remove log

* 📦 v1.0.0-next.2 (next) (HoudiniGraphql#838)

* 📦 v{VERSION} (next)

* fix changesets

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alec Aivazis <[email protected]>

* tidy up changelogs

* Restructure programatic cache api (HoudiniGraphql#841)

* fragment stores need to provide an artifact

* first pass at Record.write

* unused import

* update snapshot

* list handlers work

* move FragmentValue utility type to types file

* changeset

* linter

* start on docs and add cache.read and cache.write

* nest fragment under fragment key when writing to records

* document cache.read and cache.write

* sketch out query type

* add query type definitions to CacheDef

* query variables in imperative type def

* generate query definitions

* unused imports

* unused import

* fixed tests

* fragment inputs are persisted in artifacts

* generate input type definitions and wire up variable marhsaling

* read and write variables with arguments

* update docs

* add links to fragment args docs

* replace @manual_load with @load

* changeset

* update docs

* update release notes

* update api welcome page cache section

* fix import type

* update tests

* typo in docs

* simpler second step

* soften second step

* cleanup

* cleanup cleanup

* graphql tag should return never in default case since that means the query wasn't recognized

* make imperative types more responsive when saving

* cleanup

* fix e2e test type

* e2e check

* grammar

* explicitly mention that manual_load is gone

* remove log

* Consolidate schema polling config (HoudiniGraphql#842)

* move all schema polling things into config.watchSchema

* update docs

* fix documented watchSchema params

* update init command

* more doc updates

* clean up examples

* changeset

* 📦 v1.0.0-next.3 (next) (HoudiniGraphql#843)

* 📦 v{VERSION} (next)

* tidy up changelogs

* more cleanup

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alec Aivazis <[email protected]>

* pass session to mutation

* changeset

Co-authored-by: jycouet <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant