diff --git a/README.md b/README.md index 206bd787..ec0a82fa 100644 --- a/README.md +++ b/README.md @@ -1176,9 +1176,9 @@ console.log(result.error) // The `error` object will have a `graphQLErrors` arra ### Testing with React -Example tests that use the `LocalGraphQLClient` are provided in [the examples/create-react-app/test folder](https://github.com/nearform/graphql-hooks/blob/master/mock-client/examples/create-react-app/test/Posts.test.js). +Example tests that use the `LocalGraphQLClient` are provided in [the examples/create-react-app/test folder](https://github.com/nearform/graphql-hooks/blob/master/examples/create-react-app/test/Posts.test.tsx). -The [test-utils.js](https://github.com/nearform/graphql-hooks/blob/liana/mock-client/examples/create-react-app/test/test-utils.js) is a good example of how to create a custom render function using [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) which can wrap the render of a React component in a `ClientContext` setup to use the `LocalGraphQLClient` with supplied local queries: +The [test-utils.tsx](https://github.com/nearform/graphql-hooks/blob/master/examples/create-react-app/test/test-utils.tsx) is a good example of how to create a custom render function using [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) which can wrap the render of a React component in a `ClientContext` setup to use the `LocalGraphQLClient` with supplied local queries: ```js const customRender = (ui, options) => { diff --git a/packages/graphql-hooks/src/middlewares/README.md b/packages/graphql-hooks/src/middlewares/README.md index fe9e06fb..f1aa54f7 100644 --- a/packages/graphql-hooks/src/middlewares/README.md +++ b/packages/graphql-hooks/src/middlewares/README.md @@ -22,7 +22,7 @@ Middleware is a function with 2 parameters: - `operation` - GraphQL operation object - includes `query`, `variables` etc. - `addResponseHook` - a function that can be called from within the middleware to add a response hook - it accepts a handler to read/transform and return the data - passthrough ex.: `addResponseHook(response => response)` - `client` - the GraphQLClient instance - - `resolve`, `reject` - advanced usage only, these would be used only when we want to resolve/reject the request `Promise` early without doing the usual fetch (see [example](examples/cacheMiddleware.js)) + - `resolve`, `reject` - advanced usage only, these would be used only when we want to resolve/reject the request `Promise` early without doing the usual fetch (see [example](examples/cacheMiddleware.ts)) - `next` function - calls the next middleware function in line. Generally it should always be called, unless we want to change the control flow ## Automatic Persisted Queries (APQ) middleware