- #2832
e1fd441
Thanks @nattydodd! - MockGraphQLResponse should allow an ExecutionResult containing any data. GraphQL v15 defaulted ExecutionResult's data to be an object containing any keys but v16 narrowed that down to useunknown
instead ofany
. This change explicitly uses the default behaviour of allowing any from v15.
- #2718
591e65366
Thanks @dependabot! - Bump @babel/traverse from 7.17.9 to 7.23.2
- #2755
2fdf9c5d3
Thanks @jas7457! - Change graphQL.resolveAll() to additionally wait for any newly-pending gql calls
- #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
-
#2302
96a5023e7
Thanks @vsumner! - Update Apollo from v2 to v3. Replace dependencies onapollo-client
,apollo-cache-inmemory
andapollo-link
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.Remove
assumeImmutableResults
andunionOrIntersectionTypes
keys fromcreateGraphQLFactory()
's options, as these concepts no longer exist in Apollo 3. Cache behavior can be controlled by setting values within thecacheOptions
key, which is passed to the cache constructor. UsepossibleTypes
in place ofunionOrIntersectionTypes
.Remove the ability to filter operations using
operationName
(e.g.graphQL.operations.all({operationName: 'SampleQuery'})
). Now operations must be filtered usingquery
ormutation
keys.Add
graphQL.waitForQueryUpdates()
method to wait for batched cache updates that occur as of Apollo 3.6.0. This is useful if you need to await on the results of afetchMore
call.Remove internal
TestingApolloClient
- useApolloClient
instead.Apollo Change: The task/microtask resolution within Apollo has changed slightly, with some behaviors happening slightly later in the event loop than in Apollo 2. This has no visible effect in the browser, but
@shopify/graphql-testing
is very sensitive to these changes. To get some tests passing you may require additional task/microtask queue flushes.
-
#2593
2f731db68
Thanks @BPScott! - Remove unneededvoid 0
class property initializations -
#2595
93ec0a0e5
Thanks @BPScott! - Useimport type
when importing types
- #2543
7c8b83134
Thanks @acmertz! - Update resolveAll() to accept a custom filter option to selectively resolve requests.
- #2486
51c0434a9
Thanks @BPScott! - Deliberatly cause aNetworkError
with a useful error message if we see a fixture that is a function that returns a function. This can happen if you docreateGraphQL({MyQuery: () => fillGraphQL(MyQuery)})
because fillGraphQL returns a function. Apollo 2 already returns aNetworkError
if you do this but as it happens later on, the error message was much less helpful.
-
#2479
1f2f7da72
Thanks @BPScott! - Improve error that is thrown when you test a GraphQL operation that has not been mocked. It now details what mock was absent.Calling
createGraphQL()
with no argument now results in the operation returning a NetworkError. This makes it consistent with the error that results fromcreateGraphQL({})
.
- #2419
5cf6ca2c1
Thanks @vsumner! - Allow assumeImmutableResults results to be enabled on the apollo client
- #2389
03c1abc8c
Thanks @BPScott! - Add types field to package.json export maps to support typescript consumers that usemoduleResolution: "node16"
- #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.
- Drop support for node 12 and Safari 10, 11 and 12. Remove wildcard export in exports field. [#2277]
- Correct wildcard export to
./*
[#2209]
- Use
./*
instead of./
in package.json exports to fix deprecation warning. [#2184]
- Remove devDependency on
@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.
- Fixed babel helpers file being generated with incorrect filename in esm build. [#2082]
- Migrate from
sewing-kit-next
toloom
for building - package build output remains identical. [#2039]
- Support for
graphql
@15.x
. [#1978]
- Added file exclusion for tests to package.json and enable type checking for tests. [#2005]
- Rename test/ to tests/ [#2005]
- Updated build tooling, types are now compiled with TypeScript 4.3. [#1997]
- Add matchers entrypoint to
typesVersions
fields. This should have happened in 5.0.2 but was missed. [#1985]
- 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]
- 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
- Update
jest-matcher-utils
to26
[#1751]
- Add new build outputs (CommonJS, ESM, esnext, Node) for greater tree-shakability #1698
- Added
tslib@^1.14.1
in the list of dependencies. #1657
- Add subsequential request mocking support (#1534)
- Update
graphql
dependencies [#1379] jest.Matchers
type updated to match@types/jest
version25
[#1239]- Update
jest-matcher-utils
to25
[#1375]
- Adding
TestingApolloClient
to fix scenarios where somefetchPolicy
values produce React events firing outside of anact
scope (#1198)
- Updated to respect the new asynchronous query components from the 4.x version of
@shopify/react-graphql
(#762)
- Allow
MockLink
to return a full GraphQLError. (#768)
- Added a new entry point,
@shopify/graphql-testing/matchers
, which includes atoHavePerformedGraphQLOperation
assertion (#706) - Improved filtering GraphQL operations by allowing you to pass
query
ormutation
options (#706)
- Loosened version requirements for Apollo dependencies
createGraphQLFactory
is now a named export, not the default export (#623)- Simplified much of the external workings of the library, including removing the custom subclass of
ApolloClient
(#623)
Initial release.