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

feat: svelte query client (#683)Co-authored-by: Sergiy Petrunin <spetrunin@users.noreply.github.com> Co-authored-by: Eelco Wiersma <contact@pagebakers.nl> Co-authored-by: Pagebakers <eelco@appulse.nl> #683

Merged
merged 22 commits into from Mar 31, 2023

Conversation

DaniAkash
Copy link
Contributor

@DaniAkash DaniAkash commented Feb 18, 2023

This PR is a draft of my initial implementation of Wundergraph Client for sveltekit, created to collect feedback from the maintainers of this project. There's still few pending items I need to address before this PR can be ready:

  • figure out how to create subscription utilities in svelte
  • setup tests for the svelte query client utilities
    • subscriptions broken - need to work on a fix
  • move Wundergraph Client for sveltekit into examples

Checklist

@vercel
Copy link

vercel bot commented Feb 18, 2023

@DaniAkash is attempting to deploy a commit to the WunderGraph Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the npm label Feb 18, 2023
@Pagebakers
Copy link
Contributor

Great work! is there anything you need help with?

@DaniAkash
Copy link
Contributor Author

Great work! is there anything you need help with?

The subscription test cases are failing. Might need some help with it.

@DaniAkash
Copy link
Contributor Author

DaniAkash commented Feb 21, 2023

Since I'm new to svelte, I might have made some mistakes in the readable store implementation. Will try to figure out the issue

@Pagebakers
Copy link
Contributor

Thanks, I will try it out once I have the time.

@DaniAkash
Copy link
Contributor Author

Thanks, I will try it out once I have the time.

It is fixed now. All tests are passing 🎉

@DaniAkash DaniAkash marked this pull request as ready for review February 22, 2023 12:08
Copy link
Contributor

@Pagebakers Pagebakers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great overall! Left some comments for improvements.

Will you also add a svelte/sveltekit example?

packages/svelte-query/README.md Outdated Show resolved Hide resolved
packages/svelte-query/README.md Outdated Show resolved Hide resolved
packages/svelte-query/package.json Outdated Show resolved Hide resolved
packages/svelte-query/src/createQueryUtils.ts Outdated Show resolved Hide resolved
packages/svelte-query/src/createQueryUtils.ts Outdated Show resolved Hide resolved
packages/svelte-query/src/createQueryUtils.ts Outdated Show resolved Hide resolved
packages/svelte-query/tsconfig.json Outdated Show resolved Hide resolved
packages/svelte-query/tsconfig.build.json Show resolved Hide resolved
packages/svelte-query/package.json Outdated Show resolved Hide resolved
@DaniAkash
Copy link
Contributor Author

DaniAkash commented Mar 2, 2023

Great overall! Left some comments for improvements.

Will you also add a svelte/sveltekit example?

@Pagebakers would like your review on the derived state implementation for subscriptions. If it looks good, I'll work on improving the types

@Pagebakers
Copy link
Contributor

Code looks good, but I'm unable to run the tests locally. (with CI it's expected not to work)

 FAIL  tests/queryUtils.test.ts (8.807 s)
  Svelte Query - createSvelteClient
    ✓ should be able to init utility functions (1 ms)
    ✕ should return data (1035 ms)
    ✓ should be disabled (182 ms)
  Svelte Query - createMutation
    ✓ should trigger mutation with auth (17 ms)
    ✓ should trigger mutation (8 ms)
    ✕ should invalidate query (1010 ms)
  Svelte Query - createSubscription
    ✕ should subscribe (5006 ms)
  Svelte Query - getUser
    ✕ should return user (1021 ms)
    ```

@jensneuse jensneuse changed the title feat: svelte query client feat: svelte query client (#683)Co-authored-by: Sergiy Petrunin <spetrunin@users.noreply.github.com> Co-authored-by: Eelco Wiersma <contact@pagebakers.nl> Co-authored-by: Pagebakers <eelco@appulse.nl> Mar 31, 2023
@jensneuse jensneuse merged commit 8b3dced into wundergraph:main Mar 31, 2023
4 of 6 checks passed
@DaniAkash DaniAkash deleted the dani/svelte-query-client branch March 31, 2023 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants