Urql support for Qwik projects.

Overview

Qwik Urql ⚡️

A small library to use Urql with Qwik.

  • Query & mutation hooks
  • SSR
  • Lazy loaded client
  • Auth tokens
  • Abort signals
  • Re-execute queries (see example app buttons)
  • Reactive cache / watch for changes
  • Optimistic response (This requires a reactive cache)
  • Code generators

Setup

This is the minimal setup required for standard Query/Mutations. See the reactive cache section for watch queries

Create a new file to hold your Urql client configuration under src/client.ts and export a factory for your client.

import { createClient } from '@urql/core';

export const clientFactory = () => {
  return createClient({
    url: 'http://localhost:3000/graphql',
    exchanges: [/** ... */],
  });
};

Now provide the client in your root.tsx component and wrap the client in a QRL to ensure it is lazy loaded.

import { $, component$ } from '@builder.io/qwik';
import { clientFactory } from './client';

export default component$(() => {
  return (
    <UrqlProvider client={$(clientFactory)}>
      <QwikCity>
        <head></head>
        <body lang='en'>
          ...
        </body>
      </QwikCity>
    </UrqlProvider>
  );
});

Queries

First compile the GQL and then call useQuery. The result is a Qwik ResourceReturn which can be used with the <Resource /> component.

import { component$, JSXNode, Resource } from '@builder.io/qwik';
import { gql, OperationResult } from '@urql/core';
import { useQuery } from 'qwik-urql';

// Create
export const Query = gql`
  query Item($id: String!) {
    item(id: $id) {
      id
      title
    }
  }
`;

export default component$(() => {
  const vars = useStore({ id: '...' })
  const query = useQuery(Query, vars, { requestPolicy: 'network-only' });

  return <Resource
    value={query}
    onPending={...}
    onRejected={...}
    onResolved={...}
  />
})

Mutations

There are 2 hooks for running a mutation.

  • The useMutationResource works the exact same as useQuery. It will trigger as soon as the component loads. You can then re-trigger it by changing the input store.
  • The useMutation returns a store that includes the data, errors, loading state, and a method to execute the mutation mutate$. This allows you to delay the execution of the request until a user interaction happens.
export const Mutation = gql`
  mutation UpdateItem($id: String!, $title: String!) {
    item(id: $id, title: $title) {
      id
      title
    }
  }
`;

export default component$(() => {
  // You can pass in variables during initialisation or execution
  const initialVars = useStore({ id: '...' })
  const { data, errors, loading, mutate$ } = useMutation(Mutation, initialVars);

  return <>
    { loading ? 'loading' : 'done' }
    <button onClick$={() => mutate$({ title: '...' })}>Mutate</button>
  </>
})

SSR

Qwik doesn't hydrate on the client after SSR. This means we don't need to support the SSR exchange, everything works without it.

Reactive cache

Qwik doesn't natively support resumable subscriptions because they arent naturally serializable. To make subscriptions work, use the qwikExchange that doesn't rely on Wonka subscriptions, but rather uses Qwik signals to trigger cach-only refetches. This means subscriptions can start on the server and continue on the frontend.

To set this up, add the qwikExchange to your client and make sure it is before the cache exchange. All queries will be reactive by default.

import { createClient, dedupExchange, fetchExchange } from '@urql/core';
import { cacheExchange } from '@urql/exchange-graphcache';
import { qwikExchange, ClientFactory } from 'qwik-urql';

export const clientFactory: ClientFactory = ({ qwikStore }) => {
  return createClient({
    url: 'http://localhost:3000/graphql',
    exchanges: [
      qwikExchange(qwikStore),
      dedupExchange,
      cacheExchange({}),
      fetchExchange,
    ],
  });
};

Authentication

Make sure you follow the latest recommendations by Urql.

First update your clientFactory to include the Urql auth exchange. Notice the factory now accepts an authTokens parameter which can be used when making your requests.

export const clientFactory: ClientFactory = ({ authTokens }) => {
  const auth = authExchange<UrqlAuthTokens>({
    getAuth: async ({ authState }) => {
      if (!authState) {
        if (authTokens) {
          return authTokens;
        }

        return null;
      }

      return null;
    },
    willAuthError: ({ authState }) => {
      if (!authState) return true;
      return false;
    },
    addAuthToOperation: ({ authState, operation }) => {
      if (!authState || !authState.token) {
        return operation;
      }

      const fetchOptions =
        typeof operation.context.fetchOptions === 'function'
          ? operation.context.fetchOptions()
          : operation.context.fetchOptions || {};

      return makeOperation(operation.kind, operation, {
        ...operation.context,
        fetchOptions: {
          ...fetchOptions,
          headers: {
            ...fetchOptions.headers,
            Authorization: authState.token,
          },
        },
      });
    },
    didAuthError: ({ error }) => {
      return error.graphQLErrors.some(
        (e) => e.extensions?.code === 'FORBIDDEN'
      );
    },
  });

  return createClient({
    url: 'http://localhost:3000/graphql',
    exchanges: [dedupExchange, cacheExchange({}), auth, fetchExchange],
  });
};

Authentication has to use cookies to allow authenticated SSR. To do this, you will need to set a cookie after your user has logged in. This cookie then needs to be read from the request headers and saved to a Qwik store. (I'll include an example of this with firebase soon)

To inject your auth tokens into the clientFactory, you need to provide them in your root.tsx:

import { UrqlProvider } from 'qwik-urql';

export default component$(() => {
  // Get access to your authentication tokens
  const session = useCookie('session');

  // Add them to a store
  const authState = useStore({ token: session  });

  return (
    // Provide them to your entire app
    <UrqlProvider auth={authState} client={$(clientFactory)}>
      <QwikCity>
        <head>
          <meta charSet='utf-8' />
          <RouterHead />
        </head>
        <body lang='en'>
          <RouterOutlet />
          <ServiceWorkerRegister />
        </body>
      </QwikCity>
    </UrqlProvider>
  );
});

You should now receive auth tokens in your GQL server from both the frontend client and from SSR clients.

Code generation

Coming soon.

I plan to create a code generate to convert .graphql files like this:

query Film($id: String!) {
  film(id: $id) {
    id
    title
  }
}

Into something like this:

import { component$, JSXNode, Resource } from '@builder.io/qwik';
import { gql, OperationResult } from '@urql/core';
import { useQuery } from 'qwik-urql';

export type FilmQueryResponse = {
  film: {
    title: string;
    id: string;
  };
};

export type FilmQueryVars = {
  id: string;
};

export const FilmQuery = gql`
  query Film($id: String!) {
    film(id: $id) {
      id
      title
    }
  }
`;

export const useFilmQuery = (vars: FilmQueryVars) => {
  return useQuery(FilmQuery, vars);
};

export type FilmResourceProps = {
  vars: FilmQueryVars;
  onResolved$: (
    value: OperationResult<FilmQueryResponse, FilmQueryVars>
  ) => JSXNode;
  onPending$?: () => JSXNode;
  onRejected$?: (reason: any) => JSXNode;
};

export const FilmResource = component$((props: FilmResourceProps) => {
  const vars = props.vars;
  const value = useFilmQuery(vars);

  return (
    <Resource
      value={value}
      onPending={props.onPending$}
      onRejected={props.onRejected$}
      onResolved={props.onResolved$}
    />
  );
});

And then in your component all you need to import is this:

const vars = useStore({ id: '0' });

return <FilmResource
  vars={vars}
  onPending$={() => <div>Loading...</div>}
  onRejected$={() => <div>Error</div>}
  onResolved$={(res) => (
    <>{res.data ? res.data.film.title : 'No results'}</>
  )}
/>

Example app

The example requires this PR for authentication to work. To test authentication you will need to build it yourself and update your node_modules until it is merged

An example app is included in the repository. The source code is found in src/example

Run the mock GraphQL server with

yarn api

Then run the Qwik City app with

yarn start

Development

Development mode uses Vite's development server. For Qwik during development, the dev command will also server-side render (SSR) the output. The client-side development modules loaded by the browser.

npm run dev

Note: during dev mode, Vite will request many JS files, which does not represent a Qwik production build.

Production

The production build should generate the production build of your component library in (./lib) and the typescript type definitions in (./lib-types).

npm run build
Comments
  • slow queries are blocking the server reply

    slow queries are blocking the server reply

    Not sure how to phrase this.

    To test, I added a 5 secs sleep in my GraphQL backend.

    Now, with npm run preview, nothing is rendered for the first 5 seconds.

    I'm still very new to qwik. Is it normal that the whole rendering is blocked, or should only the specific Resource be?

    opened by bbigras 8
  • Optional/nullable fields make the whole query not render

    Optional/nullable fields make the whole query not render

    Hi! 👋

    I've ran into an issue with optional/nullable fields and I have created a reproducible branch: https://github.com/edwinvdgraaf/qwik-urql/tree/fix-option-fields with a very naive solution. Thanks for the work you've done so far, if it would help I can create a PR out of this. But I'd like some guidance if that would a) help you and b) setting up testing around the qwikExchange class.

    opened by edwinvdgraaf 3
  • npm run build: [vite]: Rollup failed to resolve import

    npm run build: [vite]: Rollup failed to resolve import "graphql" from "node_modules/@urql/core/dist/urql-core.mjs".

    Do I need to add it to build.rollupOptions.external?

    ❯ npm run build
    
    > build
    > qwik build
    
    
    tsc --incremental --noEmit
    vite build
    vite build -c adaptors/express/vite.config.ts
    eslint src/**/*.ts*
    
    vite v3.2.2 building for production...
    ✓ 67 modules transformed.
    [vite]: Rollup failed to resolve import "graphql" from "node_modules/@urql/core/dist/urql-core.mjs".
    This is most likely unintended because it can break your application at runtime.
    If you do want to externalize this module explicitly add it to
    `build.rollupOptions.external`
    error during build:
    Error: [vite]: Rollup failed to resolve import "graphql" from "node_modules/@urql/core/dist/urql-core.mjs".
    This is most likely unintended because it can break your application at runtime.
    If you do want to externalize this module explicitly add it to
    `build.rollupOptions.external`
        at onRollupWarning (file:///home/bbigras/dev/luxor/app-tech2/node_modules/vite/dist/node/chunks/dep-c842e491.js:46705:19)
        at onwarn (file:///home/bbigras/dev/luxor/app-tech2/node_modules/vite/dist/node/chunks/dep-c842e491.js:46476:13)
        at Object.onwarn (file:///home/bbigras/dev/luxor/app-tech2/node_modules/rollup/dist/es/shared/rollup.js:23263:13)
        at ModuleLoader.handleResolveId (file:///home/bbigras/dev/luxor/app-tech2/node_modules/rollup/dist/es/shared/rollup.js:22158:26)
        at file:///home/bbigras/dev/luxor/app-tech2/node_modules/rollup/dist/es/shared/rollup.js:22119:26
    
    opened by bbigras 3
  • Query returning nested properties fails to resolve with proper response.

    Query returning nested properties fails to resolve with proper response.

    Works:

    query Projects($title: String!) {
      Projects(where: {title: {like: $title}} ) {
        docs {
          id
          title
        }
      }
    } 
    

    CleanShot 2022-11-04 at 16 01 23

    Doesn't Work:

    query Projects($title: String!) {
      Projects(where: {title: {like: $title}} ) {
        docs {
          id
          title
        }
        meta {
          title
          description
        }
      }
    } 
    

    CleanShot 2022-11-04 at 16 00 39

    Even though it's not working on site, the query is actually returning the proper data from the API. It's just not resolving correctly.

    opened by isaiahdahl 3
  • GraphQL API server is on same server as server running qwik, can't get it to work, not getting any logs.

    GraphQL API server is on same server as server running qwik, can't get it to work, not getting any logs.

    I've got a digital ocean droplet running NGINX in a docker container.

    NGINX is acting as a load balancer to two node processes managed by PM2.

    A Qwik app on port 3333 and an CMS (GraphQL API) on port 3000

    The whole thing runs great when running locally.

    But trying to make this work on a production server I can't get it to work and don't know where to go from here.

    In the client.ts I've got it set up like so:

    import { createClient, dedupExchange, fetchExchange } from '@urql/core';
    import { cacheExchange } from '@urql/exchange-graphcache';
    import { qwikExchange, ClientFactory } from 'qwik-urql';
    
    export const clientFactory: ClientFactory = ({ qwikStore }) => {
      return createClient({
        url: 'http://127.0.0.1:3000/api/graphql',
        exchanges: [
          qwikExchange(qwikStore),
          dedupExchange,
          cacheExchange({}),
          fetchExchange,
        ],
      });
    };
    

    But I've tried many variations for a URL.

    For my example the domain name happens to be https://beta.fourtconstruction.com but if I use the domain name path to the graphql API (https://beta.fourtconstruction.com/api/graphql) it doesn't work either. I also don't get any logs so I don't know what's going on.

    In the rest world, when I'm doing a request on the server. I'm able to use "http://127.0.0.1:3000/api" and then when hit the actual domain when I'm making API calls client side. Qwik allows me to differentiate.

    Any tips?

    This is is the resource I'm trying to show. It's very similar to the examples:

    import { component$, Fragment, useStore } from '@builder.io/qwik';
    import { TagsResource } from './gql/tags';
    
    export default component$(() => {
    
      const storeA = useStore({ id: '6351f7b77569b72062037a82' });
    
      return (
        <Fragment>
          <h1>Testing GQL</h1>
          <TagsResource
            vars={storeA}
            onPending$={() => <div>Loading...</div>}
            onRejected$={() => <div>Error</div>}
            onResolved$={(res) => {
              return <>{res.data ? res.data.Tag.name : 'No results'}</>;
            }}
          />
        </Fragment>
      );
    })
    
    import { component$, JSXNode, Resource } from '@builder.io/qwik';
    import { gql, OperationResult } from '@urql/core';
    import { useQuery } from 'qwik-urql';
    
    /**
     * This entire file should be auto generated for every query.
     * See https://www.the-guild.dev/graphql/codegen
     */
    
    export type TagsQueryResponse = {
      Tag: {
        id: string;
        name: string;
      }
    };
    
    export type TagsQueryVars = {
      id: string;
    };
    
    export const TagsQuery = gql`
      query Tag($id: String!) {
        Tag(id: $id) {
            id
            name
        }
      } 
    `;
    
    export const useTagsQuery = (vars: TagsQueryVars) => {
      return useQuery(TagsQuery, vars, { requestPolicy: 'network-only' });
    };
    
    export type TagsResourceProps = {
      vars: TagsQueryVars;
      onResolved$: (
        value: OperationResult<TagsQueryResponse, TagsQueryVars>
      ) => JSXNode;
      onPending$?: () => JSXNode;
      onRejected$?: (reason: any) => JSXNode;
    };
    
    export const TagsResource = component$((props: TagsResourceProps) => {
      const vars = props.vars;
      const value = useTagsQuery(vars);
    
      return (
        <Resource
          value={value}
          onPending={props.onPending$}
          onRejected={props.onRejected$}
          onResolved={props.onResolved$}
        />
      );
    });
    
    opened by isaiahdahl 3
  • npm(deps-dev): bump eslint-plugin-qwik from 0.13.3 to 0.14.1

    npm(deps-dev): bump eslint-plugin-qwik from 0.13.3 to 0.14.1

    Bumps eslint-plugin-qwik from 0.13.3 to 0.14.1.

    Release notes

    Sourced from eslint-plugin-qwik's releases.

    v0.14.1

    What's Changed

    New Contributors

    Full Changelog: https://github.com/BuilderIO/qwik/compare/v0.14.0...v0.14.1

    v0.14.0

    What's Changed

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • npm(deps-dev): bump prettier from 2.7.1 to 2.8.0

    npm(deps-dev): bump prettier from 2.7.1 to 2.8.0

    Bumps prettier from 2.7.1 to 2.8.0.

    Release notes

    Sourced from prettier's releases.

    2.8.0

    diff

    🔗 Release note

    Changelog

    Sourced from prettier's changelog.

    2.8.0

    diff

    🔗 Release Notes

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • npm(deps-dev): bump eslint-plugin-qwik from 0.13.3 to 0.14.0

    npm(deps-dev): bump eslint-plugin-qwik from 0.13.3 to 0.14.0

    Bumps eslint-plugin-qwik from 0.13.3 to 0.14.0.

    Release notes

    Sourced from eslint-plugin-qwik's releases.

    v0.14.0

    What's Changed

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • npm(deps-dev): bump @typescript-eslint/eslint-plugin from 5.40.1 to 5.42.0

    npm(deps-dev): bump @typescript-eslint/eslint-plugin from 5.40.1 to 5.42.0

    Bumps @typescript-eslint/eslint-plugin from 5.40.1 to 5.42.0.

    Release notes

    Sourced from @​typescript-eslint/eslint-plugin's releases.

    v5.42.0

    5.42.0 (2022-10-31)

    Bug Fixes

    • ast-spec: add TSQualifiedName to TypeNode union (#5906) (5c316c1)
    • eslint-plugin: [no-extra-parens] handle type assertion in extends clause (#5901) (8ed7219)
    • typescript-estree: don't allow single-run unless we're in type-aware linting mode (#5893) (891b087)

    Features

    • eslint-plugin: [member-ordering] add natural sort order (#5662) (1eaae09)
    • eslint-plugin: [no-invalid-void-type] better report message for void used as a constituent inside a function return type (#5274) (d806bda)
    • typescript-estree: clarify docs and error for program project without matching TSConfig (#5762) (67744db)
    • utils: add RuleTester API for top-level dependency constraints (#5896) (0520d53)

    v5.41.0

    5.41.0 (2022-10-24)

    Bug Fixes

    • eslint-plugin: [no-base-to-string] ignore Error, URL, and URLSearchParams by default (#5839) (96e1c6c)
    • type-utils: prevent stack overflow in isTypeReadonly (#5860) (a6d8f7e), closes #4476

    Features

    • eslint-plugin: [no-unsafe-declaration-merging] switch to use scope analysis instead of type information (#5865) (e70a10a)
    • eslint-plugin: add no-unsafe-declaration-merging (#5840) (3728031)
    Changelog

    Sourced from @​typescript-eslint/eslint-plugin's changelog.

    5.42.0 (2022-10-31)

    Bug Fixes

    • ast-spec: add TSQualifiedName to TypeNode union (#5906) (5c316c1)
    • eslint-plugin: [no-extra-parens] handle type assertion in extends clause (#5901) (8ed7219)

    Features

    • eslint-plugin: [member-ordering] add natural sort order (#5662) (1eaae09)
    • eslint-plugin: [no-invalid-void-type] better report message for void used as a constituent inside a function return type (#5274) (d806bda)

    5.41.0 (2022-10-24)

    Bug Fixes

    • eslint-plugin: [no-base-to-string] ignore Error, URL, and URLSearchParams by default (#5839) (96e1c6c)
    • type-utils: prevent stack overflow in isTypeReadonly (#5860) (a6d8f7e), closes #4476

    Features

    • eslint-plugin: [no-unsafe-declaration-merging] switch to use scope analysis instead of type information (#5865) (e70a10a)
    • eslint-plugin: add no-unsafe-declaration-merging (#5840) (3728031)
    Commits
    • 1e5e9ea chore: publish v5.42.0
    • 5c316c1 fix(ast-spec): add TSQualifiedName to TypeNode union (#5906)
    • 1f14c03 docs(eslint-plugin): [consistent-type-imports] make a note about `parserOptio...
    • 8ed7219 fix(eslint-plugin): [no-extra-parens] handle type assertion in extends clause...
    • d806bda feat(eslint-plugin): [no-invalid-void-type] better report message for void us...
    • a0c8285 feat(eslint-plugin) [sort-type-union-intersection-members] rename to sort-typ...
    • 1eaae09 feat(eslint-plugin): [member-ordering] add natural sort order (#5662)
    • 3bd38ca chore(website): fix Options heading level for no-empty-interface docs (#5870)
    • 9eea5f4 chore: publish v5.41.0
    • a6d8f7e fix(type-utils): prevent stack overflow in isTypeReadonly (#5860)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • npm(deps-dev): bump @types/node from 18.11.4 to 18.11.9

    npm(deps-dev): bump @types/node from 18.11.4 to 18.11.9

    Bumps @types/node from 18.11.4 to 18.11.9.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • npm(deps-dev): bump @types/node from 18.11.4 to 18.11.8

    npm(deps-dev): bump @types/node from 18.11.4 to 18.11.8

    Bumps @types/node from 18.11.4 to 18.11.8.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • chore(deps): update dependency np to v7.6.3

    chore(deps): update dependency np to v7.6.3

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | np | 7.6.2 -> 7.6.3 | age | adoption | passing | confidence |


    Release Notes

    sindresorhus/np

    v7.6.3

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • Type mismatch between useQuery params and and gql TypedDocument

    Type mismatch between useQuery params and and gql TypedDocument

    I am following the README to construct a query, but the type that's returned by gql from @urql/core does not seem to match the type that's expected bu useQuery. I hope I'm just holding it wrong?

    It seems useQuery wants an extension of TypedDocumentNode that includes an extra kind property:

    export declare const useQuery: <Variables extends AnyVariables, Data = any>(
      query: TypedDocumentNode<Data, Variables> & {
        kind: string;
      },
    

    But the gql function just returns a TypedDocument so TypeScript will not compile this code:

    import {
      $,
      component$,
      useContext,
      useStylesScoped$,
    } from '@builder.io/qwik';
    import { gql } from '@urql/core';
    import { useQuery } from 'qwik-urql';
    import styles from './cart.css?inline';
    import { CartContext } from '../cart-provider/cart-provider';
    
    export const query = gql`
      query Products {
        products {
          totalItems
          items {
            id
            name
            slug
            description
          }
        }
      }
    `;
    
    export const Query = $(() => query);
    
    export const Cart = component$(() => {
      useStylesScoped$(styles);
      const state = useContext(CartContext);
      const query = useQuery(Query, {}, { requestPolicy: 'network-only' } );
    

    The error message that I see is:

    Argument of type 'QRL<() => TypedDocumentNode<any, AnyVariables>>' is not assignable to parameter of type 'TypedDocumentNode<any, {}> & { kind: string; }'.
      Type 'QRL<() => TypedDocumentNode<any, AnyVariables>>' is missing the following properties from type 'TypedDocumentNode<any, {}>': kind, definitionsts(2345)
    
    opened by sslotsky 0
  • chore(deps): update pnpm to v7.21.0

    chore(deps): update pnpm to v7.21.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | pnpm (source) | 7.18.2 -> 7.21.0 | age | adoption | passing | confidence |


    Release Notes

    pnpm/pnpm

    v7.21.0

    Compare Source

    Minor Changes

    • The pnpm dlx command supports the --shell-mode (or -c) option. When used, the script is executed by a shell #​5679.

    Patch Changes

    • The config command should work with the --location=global CLI option #​5841.
    • Only the pnpm add --global <pkg> command should fail if there is no global pnpm bin directory in the system PATH #​5841.

    Our Gold Sponsors

    Our Silver Sponsors

    v7.20.0

    Compare Source

    Minor Changes

    • pnpm gets its own implementation of the following commands:

      • pnpm config get
      • pnpm config set
      • pnpm config delete
      • pnpm config list

      In previous versions these commands were passing through to npm CLI.

      PR: #​5829 Related issue: #​5621

    • Add show alias to pnpm view #​5835.

    • pnpm reads settings from its own global configuration file at $XDG_CONFIG_HOME/pnpm/rc #​5829.

    • Add the 'description'-field to the licenses output #​5836.

    Patch Changes

    • pnpm rebuild should not fail if node_modules was created by pnpm version 7.18 or older #​5815.
    • pnpm env should print help.
    • Run the prepublish scripts of packages installed from Git #​5826.
    • pnpm rebuild should print a better error message when a hoisted dependency is not found #​5815.

    Our Gold Sponsors

    Our Silver Sponsors

    v7.19.0

    Compare Source

    Minor Changes

    • New setting supported in the package.json that is in the root of the workspace: pnpm.requiredScripts. Scripts listed in this array will be required in each project of the worksapce. Otherwise, pnpm -r run <script name> will fail #​5569.
    • When the hoisted node linker is used, preserve node_modules directories when linking new dependencies. This improves performance, when installing in a project that already has a node_modules directory #​5795.
    • When the hoisted node linker is used, pnpm should not build the same package multiple times during installation. If a package is present at multipe locations because hoisting could not hoist them to a single directory, then the package should only built in one of the locations and copied to the rest #​5814.

    Patch Changes

    • pnpm rebuild should work in projects that use the hoisted node linker #​5560.
    • pnpm patch should print instructions about how to commit the changes #​5809.
    • Allow the -S flag in command shims pnpm/cmd-shim#​42.
    • Don't relink injected directories if they were not built #​5792.

    Our Gold Sponsors

    Our Silver Sponsors


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • chore(deps): update dependency @typescript-eslint/eslint-plugin to v5.47.1

    chore(deps): update dependency @typescript-eslint/eslint-plugin to v5.47.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @typescript-eslint/eslint-plugin | 5.46.1 -> 5.47.1 | age | adoption | passing | confidence |


    Release Notes

    typescript-eslint/typescript-eslint

    v5.47.1

    Compare Source

    Bug Fixes
    • ast-spec: correct some incorrect ast types (#​6257) (0f3f645)
    • eslint-plugin: [member-ordering] correctly invert optionalityOrder (#​6256) (ccd45d4)

    v5.47.0

    Compare Source

    Features
    • eslint-plugin: [no-floating-promises] add suggestion fixer to add an 'await' (#​5943) (9e35ef9)

    5.46.1 (2022-12-12)

    Note: Version bump only for package @​typescript-eslint/eslint-plugin


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • chore(deps): update dependency vitest to ^0.26.0

    chore(deps): update dependency vitest to ^0.26.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | vitest | ^0.25.0 -> ^0.26.0 | age | adoption | passing | confidence |


    Release Notes

    vitest-dev/vitest

    v0.26.2

    Compare Source

       🚀 Features
       🐞 Bug Fixes
        View changes on GitHub

    v0.26.1

    Compare Source

       🚀 Features
       🐞 Bug Fixes
        View changes on GitHub

    v0.26.0

    Compare Source

       🚨 Breaking Changes
       🚀 Features
       🐞 Bug Fixes
        View changes on GitHub

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
  • chore(deps): update dependency vite to v4.0.3

    chore(deps): update dependency vite to v4.0.3

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | vite (source) | 4.0.1 -> 4.0.3 | age | adoption | passing | confidence |


    Release Notes

    vitejs/vite

    v4.0.3

    Compare Source

    v4.0.2

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 1
Releases(v0.4.2)
  • v0.4.2(Dec 1, 2022)

    • Update package.json engines (#56) 9f57b4d
    • chore(deps): update dependency @typescript-eslint/eslint-plugin to v5.45.0 (#54) 350658f
    • chore(deps): update pnpm to v7.17.1 (#53) 3302785
    • Improve exchange tests 36fda7d

    https://github.com/DustinJSilk/qwik-urql/compare/v0.4.1...v0.4.2

    Source code(tar.gz)
    Source code(zip)
  • v0.4.1(Nov 25, 2022)

    • Fix exchange processing null fields in result data c20922f
    • Improve exchange tests 0533728
    • Add initial exchange test c25b2d8
    • Remove stale wake-up triggers from exchange 627095a
    • chore(deps): update pnpm to v7.17.0 (#51) c1e5cfe
    • chore(deps): update dependency prettier to v2.8.0 (#50) 3dcb5e6
    • Delete dependabot.yml ba24b02
    • chore(deps): update dependency eslint-plugin-qwik to ^0.14.0 (#47) 9b0ed5d
    • chore(deps): update dependency @builder.io/qwik-city to ^0.0.127 (#46) 8fdbbc7
    • chore(deps): add renovate.json 0debcd1

    https://github.com/DustinJSilk/qwik-urql/compare/v0.4.0...v0.4.1

    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Nov 23, 2022)

    BREAKING CHANGES

    • Query DocumentNodes must now be QRLs to be lazy loaded. See the readme or examples for how this works.

    Changes

    • Fix pnpm release script 280156e
    • Lazy load query documents for improved performance 72d215f
    • Add option to override default watch behaviour d75ce0a
    • Add test for nested query data 1a6fd1a
    • Improve useQuery types 6efb747
    • fix broken lockfile f0b9151
    • Switch to pnpm, add first useQuery test, improve types df44e26
    • npm(deps-dev): bump typescript from 4.8.4 to 4.9.3 (#42) d7ee53b
    • npm(deps-dev): bump @typescript-eslint/parser from 5.43.0 to 5.44.0 (#41) f19e1b0
    • Set dependabot interval to daily c81d737
    • npm(deps-dev): bump vite from 3.2.3 to 3.2.4 (#40) 625227b
    • npm(deps-dev): bump @typescript-eslint/eslint-plugin (#39) 4b88108
    • npm(deps-dev): bump eslint from 8.27.0 to 8.28.0 (#38) 0ca9297
    • npm(deps-dev): bump @builder.io/qwik-city from 0.0.122 to 0.0.123 (#37) 1a187fe
    • Update dependencies and fix workflow build 478dc31
    • Use yarn in test workflow 89e6784
    • Create test.yml dc5d832
    • Add initial unit tests 1e6c4e6
    • npm(deps-dev): bump @builder.io/qwik from 0.13.1 to 0.13.3 (#34) a434ee7
    • npm(deps-dev): bump eslint-plugin-qwik from 0.13.1 to 0.13.3 (#33) 70a357f
    • npm(deps-dev): bump @builder.io/qwik-city from 0.0.121 to 0.0.122 (#32) eb30c62

    https://github.com/DustinJSilk/qwik-urql/compare/v0.3.0...v0.4.0

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Nov 12, 2022)

    • Use Urql subscriptions rather than multiple queries (#16) 3068e6b
    • npm(deps-dev): bump eslint and @types/eslint (#23) 093eaba
    • npm(deps-dev): bump @types/node from 18.11.0 to 18.11.4 (#22) 7a4ae35
    • npm(deps-dev): bump @typescript-eslint/parser from 5.40.1 to 5.41.0 (#20) 08e9245
    • Reuse Urql clients during SSR (#15) cc9f216
    • Use Node 16 LTS and add .nvmrc (#14) f694d9a
    • Run test API in browser to support codeflow (#13) f38402c
    • bump @typescript-eslint/parser from 5.40.0 to 5.40.1 (#12) 2618f59
    • npm(deps-dev): bump typescript from 4.8.3 to 4.8.4 (#8) 96d6f2c
    • npm(deps-dev): bump @typescript-eslint/eslint-plugin (#11) c297c5d
    • npm(deps-dev): bump eslint from 8.23.1 to 8.25.0 (#9) 24b642f
    • npm(deps-dev): bump vite from 3.1.1 to 3.1.8 (#7) 7a6182e
    • Use watch queries by default e82f54f
    • Fix missing mutation error type 40884ed
    • Deprecate WatchedOperationResult cd6cde4
    • Fix prettier config 7224a60

    https://github.com/DustinJSilk/qwik-urql/compare/v0.2.3...v0.3.0

    Source code(tar.gz)
    Source code(zip)
  • v0.2.3(Oct 17, 2022)

    • Fix Qwik 0.11.1 & eslint errors + improve exchange a7b68c6
    • Update @urql/exchange-graphcache b35146d
    • npm(deps-dev): bump np from 7.6.1 to 7.6.2 (#5) 4ff8a33
    • npm(deps-dev): bump eslint-plugin-qwik from 0.11.0 to 0.11.1 (#3) 78ce83b
    • npm(deps-dev): bump @typescript-eslint/parser from 5.37.0 to 5.40.0 (#2) 0b1084c
    • npm(deps-dev): bump @types/node from 18.8.3 to 18.11.0 (#1) 15a3493
    • Update dependabot.yml 0e7c454

    https://github.com/DustinJSilk/qwik-urql/compare/v0.2.2...v0.2.3

    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(Oct 17, 2022)

    • Switch to useResource in useWatchQuery for loading states e0b90d7
    • Merge branch 'main' of github.com:DustinJSilk/qwik-urql 3e97377
    • Update qwik version f130a11
    • Stop serializing requests in QwikExchange d49bb81
    • Create dependabot.yml 8a804ea

    https://github.com/DustinJSilk/qwik-urql/compare/v0.2.1...v0.2.2

    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Oct 16, 2022)

    • Deprecate SSR 5ac62e6
    • Remove unecessary recursive option from watch 4b986ca

    https://github.com/DustinJSilk/qwik-urql/compare/v0.2.0...v0.2.1

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Oct 16, 2022)

    Add support for watched queries

    • Update qwik version 1080357
    • Export qwikExchange 47a20a0
    • Initial support for watched queries 5e4b1c2
    • Update example to include subscribed query c9f168f
    • Add qwik-exchange for initial reactive cache 16cc238
    • Update useMutation to not return a resource 66d57a2

    https://github.com/DustinJSilk/qwik-urql/compare/v0.1.3...v0.2.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.3(Oct 9, 2022)

  • v0.1.1(Oct 9, 2022)

  • v0.1.0(Oct 9, 2022)

    • Add publish registry d183c8b
    • Initial project commit 3bd5689

    https://github.com/DustinJSilk/qwik-urql/compare/b922574ec83935ad39cebb831aea167b6f9cf108...v0.1.0

    Source code(tar.gz)
    Source code(zip)
Owner
null
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Qwik City adapter for trpc.io

tRPC ?? Qwik City End-to-end typesafe APIs made easy with tRPC.io in Qwik City applications. Build & consume fully typesafe APIs, without schemas or c

Giorgio Boa 29 Oct 11, 2022
An e-commerce storefront starter built with Qwik and Vendure

Vendure Qwik Storefront Starter️ An e-commerce storefront for Vendure built with Qwik & Qwik City. ?? qwik-storefront.vendure.io To do Cart ✅ Checkout

Vendure 81 Dec 31, 2022
qwik.wrong-lang.click website source code

Qwik App ⚡️ Qwik Docs Discord Qwik Github @QwikDev Vite Partytown Mitosis Builder.io Project Structure Inside of you project, you'll see the following

Wrong Lang 3 Oct 7, 2022
BETA partytown-qwik

Qwik Partytown ?? This is a package that facilitates the implementation of PartyTown in Qwik. If you don't know what Qwik is See The implementation is

Leifer Mendez 7 Dec 20, 2022
Generate translated routes for your qwik project.

qwik-translate-routes Generate translated routes for your qwik project. Installation // npm npm install -D qwik-translate-routes // yarn yarn add -D q

Alexandre Fernandez 5 Dec 28, 2022
Query for CSS brower support data, combined from caniuse and MDN, including version support started and global support percentages.

css-browser-support Query for CSS browser support data, combined from caniuse and MDN, including version support started and global support percentage

Stephanie Eckles 65 Nov 2, 2022
A refined tool for exploring open-source projects on GitHub with a file tree, rich Markdown and image previews, multi-pane multi-tab layouts and first-class support for Ink syntax highlighting.

Ink codebase browser, "Kin" ?? The Ink codebase browser is a tool to explore open-source code on GitHub, especially my side projects written in the In

Linus Lee 20 Oct 30, 2022
🏆 ETHAmsterdam 2022 Finalist 👐 Support your favorite projects with yield

Yieldgate Yield Gate is a new monetisation tool for anyone to start receiving donations, or to support their favourite public goods projects, creators

null 16 Dec 15, 2022
A website for tracking community support for BIP21 QR codes that support on-chain and lightning bitcoin payments.

BIP21 Microsite This is a WIP microsite to promote the usage of a BIP21 payment URI QR code that can include lightning invoices or offers. Wallet supp

Stephen DeLorme 16 Nov 27, 2022
Persistent key/value data storage for your Browser and/or PWA, promisified, including file support and service worker support, all with IndexedDB. Perfectly suitable for your next (PWA) app.

BrowstorJS ?? ?? ?? Persistent key/value data storage for your Browser and/or PWA, promisified, including file support and service worker support, all

Nullix 8 Aug 5, 2022
A set of best practices for JavaScript projects

中文版 | 日本語版 | 한국어 | Русский | Português Project Guidelines · While developing a new project is like rolling on a green field for you, maintaining it is

Elsewhen 28.4k Jan 1, 2023
Cheatsheet for the JavaScript knowledge you will frequently encounter in modern projects.

Modern JavaScript Cheatsheet Image Credits: Ahmad Awais ⚡️ If you like this content, you can ping me or follow me on Twitter ?? Introduction Motivatio

Manuel Beaudru 23.9k Jan 4, 2023
Mini projects built with HTML5, CSS & JavaScript. No frameworks or libraries

20+ Web Projects With Vanilla JavaScript This is the main repository for all of the projects in the course. Course Link Course Info Website # Project

Brad Traversy 14.1k Jan 4, 2023
Open Source projects are a project to improve your JavaScript knowledge with JavaScript documentation, design patterns, books, playlists.

It is a project I am trying to list the repos that have received thousands of stars on Github and deemed useful by the JavaScript community. It's a gi

Cihat Salik 22 Aug 14, 2022
A Web UI toolkit for creating rapid prototypes, experiments and proof of concept projects.

MinimalComps2 A Web UI tookkit for creating rapid prototypes, experiments and proof of concept projects. The site: https://www.minimalcomps2.com/ Full

Keith Peters 32 Apr 18, 2022
The repository contains the list of awesome✨ & cool web development beginner-friendly✌️ projects!

Web-dev-mini-projects The repository contains the list of awesome ✨ & cool web development beginner-friendly ✌️ projects! Web-dev-mini-projects ADD AN

Ayush Parikh 265 Jan 3, 2023