"export 'makeOperation' was not found in '@urql/core' #1120
Answered
by
JohnAtFenestra
JohnAtFenestra
asked this question in
Q&A
-
Using "urql": "^1.10.3" https://github.com/FormidableLabs/urql/blob/main/docs/common-questions.md states: If you need async fetchOptions you can add an exchange that looks like this:
import { makeOperation } from '@urql/core';
export const fetchOptionsExchange = (fn: any): Exchange => ({ forward }) => ops$ => {
return pipe(
ops$,
mergeMap((operation: Operation) => {
const result = fn(operation.context.fetchOptions);
return pipe(
typeof result.then === 'function' ? fromPromise(result) : fromValue(result),
map((fetchOptions: RequestInit | (() => RequestInit)) => {
return makeOperation(operation.kind, operation, {
...operation.context,
fetchOptions,
});
})
);
}),
forward
);
}; However, creating this code produces the following error: warning in ./src/naep-lib/urql-client-factories/fetchOptionsExchange.js
"export 'makeOperation' was not found in '@urql/core'
ℹ 「wds」: Project is running at https://0.0.0.0:8080/
ℹ 「wds」: webpack output is served from
App · Opening default browser at https://localhost:8080 I also noticed VSCode complains about the same thing when I checked out the current source. Any thoughts? |
Beta Was this translation helpful? Give feedback.
Answered by
JohnAtFenestra
Nov 5, 2020
Replies: 1 comment
-
Solved. I had to explicitly add |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kitten
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solved. I had to explicitly add
@urql/core
topackage.json