+9
.changeset/fair-flies-grab.md
+9
.changeset/fair-flies-grab.md
···
···+Add a built-in `gql` tag function helper to `@urql/core`. This behaves similarly to `graphql-tag` but only warns about _locally_ duplicated fragment names rather than globally. It also primes `@urql/core`'s key cache with the parsed `DocumentNode`.
+30
docs/api/core.md
+30
docs/api/core.md
···+This is a `gql` tagged template literal function, similar to the one that's also commonly known from+`graphql-tag`. It can be used to write GraphQL documents in a tagged template literal and returns a+Unlike `graphql-tag`, this function outputs a warning in development when names of fragments in the+document are duplicated. It does not output warnings when fragment names were duplicated globally
+3
-3
docs/api/graphcache.md
+3
-3
docs/api/graphcache.md
······If any fields on the fragment require variables, you can pass them as the third argument like so:···
······If any fields on the fragment require variables, you can pass them as the third argument like so:···
+84
docs/basics/queries.md
+84
docs/basics/queries.md
···+All framework bindings — meaning `urql`, `@urql/preact`, `@urql/svelte`, and `@urql/vue` — reexport+[`Client`](../api/core.md#client), built-in exchanges, and other utilities that are shared between+Wherever `urql` accepts a query document, you may either pass a string or a `DocumentNode`. `gql` is+a utility that allows a `DocumentNode` to be created directly, and others to be interpolated into+it, which is useful for fragments for instance. This function will often also mark GraphQL documents+Since all framework bindings also re-export `@urql/core`, we may also import `gql` from `'urql'`,+We can also start interpolating other documents into the tag function. This is useful to compose+fragment documents into a larger query, since it's common to define fragments across components of+There are some more utilities that `@urql/core` exports. [All of them are listed in the API docs for
+2
-2
docs/graphcache/computed-queries.md
+2
-2
docs/graphcache/computed-queries.md
······-> [graphql-tag](https://github.com/apollographql/graphql-tag) because `writeFragment` only accepts
······
+3
-3
docs/graphcache/custom-updates.md
+3
-3
docs/graphcache/custom-updates.md
······-> [graphql-tag](https://github.com/apollographql/graphql-tag) because `writeFragment` only acceptsThis can be useful for instance if we have a mutation that doesn't return the type that the GraphQL···
······This can be useful for instance if we have a mutation that doesn't return the type that the GraphQL···
+1
-2
exchanges/auth/package.json
+1
-2
exchanges/auth/package.json
+1
-2
exchanges/execute/package.json
+1
-2
exchanges/execute/package.json
+15
-7
exchanges/execute/src/execute.test.ts
+15
-7
exchanges/execute/src/execute.test.ts
······
······
+1
-2
exchanges/graphcache/package.json
+1
-2
exchanges/graphcache/package.json
+1
-1
exchanges/graphcache/src/ast/traversal.test.ts
+1
-1
exchanges/graphcache/src/ast/traversal.test.ts
+1
-1
exchanges/graphcache/src/ast/variables.test.ts
+1
-1
exchanges/graphcache/src/ast/variables.test.ts
+1
-2
exchanges/graphcache/src/cacheExchange.test.ts
+1
-2
exchanges/graphcache/src/cacheExchange.test.ts
+1
-1
exchanges/graphcache/src/extras/relayPagination.test.ts
+1
-1
exchanges/graphcache/src/extras/relayPagination.test.ts
+1
-1
exchanges/graphcache/src/extras/simplePagination.test.ts
+1
-1
exchanges/graphcache/src/extras/simplePagination.test.ts
+1
-1
exchanges/graphcache/src/offlineExchange.test.ts
+1
-1
exchanges/graphcache/src/offlineExchange.test.ts
+1
-1
exchanges/graphcache/src/operations/query.test.ts
+1
-1
exchanges/graphcache/src/operations/query.test.ts
+1
-1
exchanges/graphcache/src/operations/write.test.ts
+1
-1
exchanges/graphcache/src/operations/write.test.ts
+1
-2
exchanges/graphcache/src/store/store.test.ts
+1
-2
exchanges/graphcache/src/store/store.test.ts
···
+1
-1
exchanges/graphcache/src/test-utils/examples-1.test.ts
+1
-1
exchanges/graphcache/src/test-utils/examples-1.test.ts
+1
-1
exchanges/graphcache/src/test-utils/examples-2.test.ts
+1
-1
exchanges/graphcache/src/test-utils/examples-2.test.ts
+1
-1
exchanges/graphcache/src/test-utils/examples-3.test.ts
+1
-1
exchanges/graphcache/src/test-utils/examples-3.test.ts
+1
-1
exchanges/graphcache/src/test-utils/suite.test.ts
+1
-1
exchanges/graphcache/src/test-utils/suite.test.ts
+1
-2
exchanges/multipart-fetch/package.json
+1
-2
exchanges/multipart-fetch/package.json
+179
exchanges/multipart-fetch/src/__snapshots__/multipartFetchExchange.test.ts.snap
+179
exchanges/multipart-fetch/src/__snapshots__/multipartFetchExchange.test.ts.snap
··············································································
··············································································
+1
-1
exchanges/multipart-fetch/src/test-utils.ts
+1
-1
exchanges/multipart-fetch/src/test-utils.ts
+1
-2
exchanges/persisted-fetch/package.json
+1
-2
exchanges/persisted-fetch/package.json
+1
-1
exchanges/persisted-fetch/src/test-utils.ts
+1
-1
exchanges/persisted-fetch/src/test-utils.ts
+1
-2
exchanges/populate/package.json
+1
-2
exchanges/populate/package.json
+7
-2
exchanges/populate/src/populateExchange.test.ts
+7
-2
exchanges/populate/src/populateExchange.test.ts
+2
-2
exchanges/refocus/src/refocusExchange.test.ts
+2
-2
exchanges/refocus/src/refocusExchange.test.ts
···
+2
-2
exchanges/request-policy/src/requestPolicyExchange.test.ts
+2
-2
exchanges/request-policy/src/requestPolicyExchange.test.ts
···
+2
-2
exchanges/retry/src/retryExchange.test.ts
+2
-2
exchanges/retry/src/retryExchange.test.ts
-1
package.json
-1
package.json
+1
-2
packages/core/package.json
+1
-2
packages/core/package.json
+1
-1
packages/core/src/client.test.ts
+1
-1
packages/core/src/client.test.ts
···/** NOTE: Testing in this file is designed to test both the client and its interaction with default Exchanges */
···/** NOTE: Testing in this file is designed to test both the client and its interaction with default Exchanges */
+114
packages/core/src/exchanges/__snapshots__/fetch.test.ts.snap
+114
packages/core/src/exchanges/__snapshots__/fetch.test.ts.snap
······················································
······················································
+32
packages/core/src/exchanges/__snapshots__/subscription.test.ts.snap
+32
packages/core/src/exchanges/__snapshots__/subscription.test.ts.snap
············
············
+1
-58
packages/core/src/exchanges/cache.test.ts
+1
-58
packages/core/src/exchanges/cache.test.ts
······
······
+47
-78
packages/core/src/exchanges/cache.ts
+47
-78
packages/core/src/exchanges/cache.ts
············
············
+60
packages/core/src/gql.test.ts
+60
packages/core/src/gql.test.ts
···
···
+64
packages/core/src/gql.ts
+64
packages/core/src/gql.ts
···
···+'While fragment names may not be unique across your source, each name must be unique per document.'
+1
packages/core/src/index.ts
+1
packages/core/src/index.ts
+190
packages/core/src/internal/__snapshots__/fetchSource.test.ts.snap
+190
packages/core/src/internal/__snapshots__/fetchSource.test.ts.snap
··························································································
··························································································
+1
-1
packages/core/src/test-utils/samples.ts
+1
-1
packages/core/src/test-utils/samples.ts
+1
-1
packages/core/src/utils/request.test.ts
+1
-1
packages/core/src/utils/request.test.ts
+1
-2
packages/introspection/package.json
+1
-2
packages/introspection/package.json
-1
packages/next-urql/package.json
-1
packages/next-urql/package.json
-1
packages/preact-urql/package.json
-1
packages/preact-urql/package.json
+2
-2
packages/preact-urql/src/hooks/useMutation.test.tsx
+2
-2
packages/preact-urql/src/hooks/useMutation.test.tsx
······
······
-1
packages/react-urql/package.json
-1
packages/react-urql/package.json
+2
-2
packages/react-urql/src/hooks/useMutation.test.tsx
+2
-2
packages/react-urql/src/hooks/useMutation.test.tsx
······
······
+1
-1
packages/react-urql/src/hooks/useRequest.test.ts
+1
-1
packages/react-urql/src/hooks/useRequest.test.ts
+1
-1
packages/react-urql/src/test-utils/ssr.test.tsx
+1
-1
packages/react-urql/src/test-utils/ssr.test.tsx
+1
-6
yarn.lock
+1
-6
yarn.lock
···resolved "https://registry.yarnpkg.com/@urql/devtools/-/devtools-2.0.2.tgz#0991bc3bb09444b162ef56518b76f64f286954fc"integrity sha512-f3gIx4NDOuWdXC54m4VQlLKNtYHl6PITSEqexH6xiktzvH7QcwS5hNPg0Fkki8cas/DZtkmDpwxNV1uRZ5xlvA==···resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e"integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==-resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.11.0.tgz#1deb53a01c46a7eb401d6cb59dec86fa1cccbffd"-integrity sha512-VmsD5pJqWJnQZMUeRwrDhfgoyqcfwEkvtpANqcoUG8/tOLkwNgU9mzub/Mc78OJMhHjx7gfAMTxzdG43VGg3bA==
···resolved "https://registry.yarnpkg.com/@urql/devtools/-/devtools-2.0.2.tgz#0991bc3bb09444b162ef56518b76f64f286954fc"integrity sha512-f3gIx4NDOuWdXC54m4VQlLKNtYHl6PITSEqexH6xiktzvH7QcwS5hNPg0Fkki8cas/DZtkmDpwxNV1uRZ5xlvA==···resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e"integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==