- Updated dependencies [
1171b00
]:- @shopify/[email protected]
- @shopify/[email protected]
- Updated dependencies [
2b70145
]:- @shopify/[email protected]
- @shopify/[email protected]
- Updated dependencies [
0fc2d54
]:- @shopify/[email protected]
- @shopify/[email protected]
- Updated dependencies [
5546b1d
,d691952
]:- @shopify/[email protected]
- [email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- Updated dependencies [
bdebd9197
]:
-
#2785
97f8f6cf5
Thanks @vsumner! - Drop support for node 14 and 16. Support node LTS and up. -
#2787
f50049004
Thanks @vsumner! - Drop support for React 17
- Updated dependencies [
97f8f6cf5
,f50049004
]:- @shopify/[email protected]
- [email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- Updated dependencies [
12f780698
]:
-
#2718
591e65366
Thanks @dependabot! - Bump @babel/traverse from 7.17.9 to 7.23.2 -
Updated dependencies [
591e65366
]:- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- Updated dependencies [
a4eae7db3
]:- @shopify/[email protected]
- @shopify/[email protected]
- #2708
a224c11d7
Thanks @markbann! - - upgrade @apollo/client to the latest (3.8.10)- set
connectToDevTools
to false by default - allow consumers to pass
defaultOptions
into the options of
- set
- Updated dependencies [
20cbe440a
]:- @shopify/[email protected]
- Updated dependencies [
a3b5c3fc0
]:- @shopify/[email protected]
- @shopify/[email protected]
-
#2608
ba4da84d5
Thanks @BPScott! - Useimport type
everywhere that we deal with importing types -
Updated dependencies [
ba4da84d5
]:- @shopify/[email protected]
- [email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
-
#2302
96a5023e7
Thanks @vsumner! - Update Apollo from v2 to v3. Replace dependencies onapollo-client
,apollo-cache-inmemory
,apollo-link
,@apollo/react-common
and@apollo/react-hooks
with@apollo/client
. When updating to Apollo v3,@shopify/graphql-persisted
,@shopify/graphql-testing
,@shopify/react-graphql
and@shopify/react-graphql-universal-provider
should all be updated at the same time, and you should follow the Apollo3 migration guide, and note any breaking changes in the Apollo3 changelog, paying particular attention to changes around import paths and cache behavior.Update the return type of
useMutation
toFetchResult
to align it with what the Apollo client returns. Thedata
key that gets returned from calling the function returned byuseMutation
may now beundefined
in addition to possibly beingnull
.We have tested SSR behaviour in the Shopify Admin (aka
web
) which uses a single render pass. We expect everything to work in SSR environments that use multiple passes of@shopify/react-html
too, however be aware that multi-pass has not been exhaustively proven in production.Apollo Change:
ApolloClient.{query,mutate,etc}
now have built-in type inference. We suggest enablinggraphql-typescript-definitions
's--export-format=documentWithTypedDocumentNode
option to generate.graphql.d.ts
files that produce types that Apollo's own client and hooks can take advantage of.Apollo Change:
useQuery().errors
,useMutation().errors
and other error arrays are now readonly arrays (i.e.readonly GraphQLError[]
). Previously they returned mutable arrays (i.e.GraphQLError[]
).Apollo Change: The message of
ApolloError
Error instances are no longer prefixed withGraphQL Error:
orNetwork Error:
.Apollo Change: The value of a complete but empty
data
payload is nowundefined
, in Apollo 2 it was an empty object (i.e.{}
). Complete but empty data can occur if you have a query that uses the@include
directive that results in you requesting an empty query, for instancequery PetQuery($includePets: Boolean! = false) { pets @include(if: $includePets) { name } }
.Apollo Change: In Apollo 2 making a query with the
fetchPolicy: 'cache-and-network'
option also seemed to imply settingnotifyOnNetworkStatusChange: true
, and thus if you calledfetchMore
on that query then the loading state would be updated. In Apollo 3 this side-effect is no longer present. If you want a query to update its loading state after callingfetchMore
then you must explicitly set thenotifyOnNetworkStatusChange: true
option.
-
#2595
93ec0a0e5
Thanks @BPScott! - Useimport type
when importing types -
Updated dependencies [
2f731db68
,93ec0a0e5
]:- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- Updated dependencies [
bd204450f
]:- @shopify/[email protected]
- Updated dependencies [
2aa32e8b8
]:- @shopify/[email protected]
- @shopify/[email protected]
-
#2409
0bff6fad7
Thanks @BPScott! - Update types to account changes in TypeScript 4.8 and 4.9. Propogate contstraints on generic types and update type usage relating toWindow
andNavigator
. Technically this makes some types stricter, as attempting to passnull|undefined
into certain functions is now disallowed by TypeScript, but these were never expected runtime values in the first place. -
#2409
0bff6fad7
Thanks @BPScott! -extends {}
has been added to theData
/Variables
/DeepPartial
generic types on theuseQuery
anduseGraphQLDocument
hooks, thecreateAsyncQuery
,createAsyncQueryComponent
functions and theQuery
component. If you use typescript'sstrictNullChecks
option and define functions that contain generics that are then passed into any of these functions you may need add anextends {}
to your code as well, per the typescript 4.8 changelog. For example, replace<Data>
with<Data extends {}>
.
- Updated dependencies [
0bff6fad7
,0bff6fad7
]:- @shopify/[email protected]
- @shopify/[email protected]
- Updated dependencies []:
- @shopify/[email protected]
-
#2408
2094cb39a
Thanks @BPScott! - Internal typing adjustments as a result of updating Typescript -
Updated dependencies [
2094cb39a
]:- @shopify/[email protected]
- Updated dependencies []:
- @shopify/[email protected]
-
#2389
03c1abc8c
Thanks @BPScott! - Add types field to package.json export maps to support typescript consumers that usemoduleResolution: "node16"
-
Updated dependencies [
03c1abc8c
]:- @shopify/[email protected]
- [email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
-
#2363
6c4a181ca
Thanks @ryanwilsonperkin! - Use loading=true from server-side-rendered queries when ssr is set to falseThis is for consistency with the way that Apollo does things and to ensure that we avoid hydration mismatch errors when the client will initially render with true while the server rendered with false.
Functionally, this means that if you previously relied on loading=false in your component code as an indication of server side rendering with an ssr false value, you should instead make use of the "called" value to determine whether or not it was called (this will still be false).
- Updated dependencies [
b42a99a7d
]:- @shopify/[email protected]
- @shopify/[email protected]
- @shopify/[email protected]
- #2323
44eb34763
Thanks @atesgoral! - Add additional headers and standardize X-prefixed ones
- #2320
f70a02825
Thanks @vsumner! - Update useQuery refetch so that it can recover from a network error. Add more tests.
- No updates. Transitive dependency bump.
- Drop support for node 12 and Safari 10, 11 and 12. Remove wildcard export in exports field. [#2277]
- Fix NetworkStatus type export. [#2216]
- No updates. Transitive dependency bump.
- Correct wildcard export to
./*
[#2209]
- Add NetworkStatus type export. [#2196]
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- Use
./*
instead of./
in package.json exports to fix deprecation warning. [#2184]
- Reduce usage of
@shopify/useful-types
by using built-in types. [#2163]
- No updates. Transitive dependency bump.
- Rerelease after failed publish. No code changes.
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- Fixed babel helpers file being generated with incorrect filename in esm build. [#2082]
- No updates. Transitive dependency bump.
- Use the named import of ApolloClient [#2052]
- Migrate from
sewing-kit-next
toloom
for building - package build output remains identical. [#2039]
- No updates. Transitive dependency bump.
- Enable type checking in tests and fix type errors. [#2034]
- Fixed an issue with the SSR link when an error is thrown. [#2036]
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- Added file exclusion for tests to package.json. [#2005]
- Updated build tooling, types are now compiled with TypeScript 4.3. [#1997]
- Ensure
tsconfig.tsbuildinfo
file is not uploaded to the npm registry. [#1982]
- Update to latest sewing-kit-next for build. Update
types
/typesVersions
fields to point directly into the build folder [#1980]
- Officially supports React
17.x
1969
- Changes to tests for React-17 compatibility in dev. #1957
- No updates. Transitive dependency bump.
- Update minimum supported node version to 12.14.0. Add engines field to help enforce usage of this version. #1906
- Removed dependency on tslib, as we no-longer compile with
tsc
. #1829
- Updated multi-build outputs to include mandatory extensions to fix "Module not found" issues reported by ESM supported bundlers #1759
- Add new build outputs (CommonJS, ESM, esnext, Node) for greater tree-shakability #1698
- Added
tslib@^1.14.1
in the list of dependencies. #1657
- Replace Apollo declarative Query component with
useQuery
hook (#1519)
- Improve typings for
usePrefetch
to accept afetchPolicy
inoptions
(#1437)
- Update dependencies from
react-apollo
to@apollo/react-common
,@apollo/react-components
, and@apollo/react-hooks
(#1321)
- Improve typings for
useBackgroundQuery
by allowing thefetchPolicy
option. (#1293).
- Fixed when using
no-cache
fetch policy and data is undefined (#1244).
- Added a
createAsyncQuery
function that can create queries that are only loaded when executed (#1153).
- Improved typings to avoid cases where TypeScript allowed variables to be omitted incorrectly. These typings now require
[email protected]
(#1153).
- Changed some type imports to fix type errors when using
[email protected]
. Projects that use 2.x may have some typing issues as changes were made toreact-apollo
that make it impossible to support the types for both versions. (#1087)
- Adds support for
ssr=false
inuseQuery
(951)
- Fix SSR when using
cache-and-network
fetch policy withuseQuery
(#928)
- Removed the
createGraphQLClient
/ApolloClient
exports, and instead export the tools to build an operation-tracking link (createSsrExtractableLink
/SsrExtractableLink
). Projects using thecreateGraphQLClient
utility to create a client with aresolve
method can instead use the link andSsrExtractableLink#resolveAll()
directly. (#878)
- Add missing dependencies (832)
- Adds SSR extractable link to support GraphQL Self-serialization (810)
- Using
useQuery
withfetchPolicy
set tono-cache
no longer runs during server renders (previously, using such a query would causeextract
to loop indefinitely) (#770)
- Fixed an issue where
useBackgroundQuery
would not unsubscribe when options change
- Updated to depend on the 3.x version of
@shopify/react-async
(#762)
useQuery
now returnsundefined
instead of an empty object{}
when there's no data (#751)- Fix re-wrapping query result under
current
key when usingno-cache
fetch policy (as a result of leaking implementation details, exposingref
object intead of what it is representing)
fetchPolicy
is now compatible with[email protected]
'sWatchQueryFetchPolicy
options (#729)
- Queries are no longer waited on during server render when
skip
istrue
(#726) - The result of calling
useQuery
is now referentially stable when variables stay deep-equal between calls (previously, using a different object with the same values would change the result) (#726).
- Fixed an issue where
useQuery
was watching a query even whenskip
was true (#721)
- Fixed an issue where
useQuery
with an async query component would not cause the query’s bundle to be included in the initial HTML.
- Components created with
createAsyncQueryComponent
now call theirchildren
prop with a loading state while the query is still being fetched (#707)
- Fixed an issue where
useQuery
would not be performed during server renders (#702)
- Added
useQuery
anduseApolloClient
hooks (#663)
- Added
useMutation
hook (#653)
This library now requires React 16.8 because of changes to @shopify/react-effect
.
- You can now import
GraphQLData
andGraphQLVariables
to extract the data or variable types from the component returned bycreateAsyncQueryComponent
(#529)
AsyncQueryComponentType
now conforms tographql-typed
’sGraphQLOperation
interface (#529)
createAsyncQueryComponent
now accepts adefer
property that dictates whether that component should wait until mount or idle to start loading the query (#517)- The component returned from
createAsyncQueryComponent
and its staticPreload
,Prefetch
, andKeepFresh
components all accept anasync
prop that is an object with an optionaldefer
property, which controls the way loading is done for just that element (#517)
- Added some additional generic types for extracting default from queries.
- Fixed some broken API choices
- Initial release