We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why do I get this error? Error: Network error: Network request failed
Error: Network error: Network request failed
My store
export const client = new ApolloClient({ link: createUploadLink({ uri: 'http://localhost:3030/graphql' }), cache: new InMemoryCache() }) const middlewares = [client.middleware(), thunk] export const store = createStore( reducers(client), undefined, composeWithDevTools(applyMiddleware(...middlewares)), )
My backend here
My mutation:
export default gql` mutation($file: Upload!) { uploadFile(file: $file) } `
My action:
_onShowSignupPress = async () => { const { profilePhotoUri } = this.state const file = new ReactNativeFile({ uri: profilePhotoUri, type: 'image/jpeg', name: 'photo.jpg' }) const response = await this.props.mutate({ variables: { file } }) console.log(response) }
after APOLLO_MUTATION_INIT - APOLLO_MUTATION_ERROR
{ type: 'APOLLO_MUTATION_INIT', mutationString: 'mutation ($file: Upload!) {\n uploadFile(file: $file)\n}\n', mutation: { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'mutation', variableDefinitions: [ { kind: 'VariableDefinition', variable: { kind: 'Variable', name: { kind: 'Name', value: 'file' } }, type: { kind: 'NonNullType', type: { kind: 'NamedType', name: { kind: 'Name', value: 'Upload' } } }, defaultValue: null } ], directives: [], selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'Field', alias: null, name: { kind: 'Name', value: 'uploadFile' }, arguments: [ { kind: 'Argument', name: { kind: 'Name', value: 'file' }, value: { kind: 'Variable', name: { kind: 'Name', value: 'file' } } } ], directives: [], selectionSet: null } ] } } ], loc: { start: 0, end: 62, source: { body: '\n mutation($file: Upload!) {\n uploadFile(file: $file)\n }\n', name: 'GraphQL request', locationOffset: { line: 1, column: 1 } } } }, variables: { file: { uri: 'file:///Users/xyz/Library/Developer/CoreSimulator/Devices/BF0FFACC-B049-403D-A27C-048B9BC54636/data/Containers/Data/Application/BCB8B96B-DC71-4ECC-8537-6E4174F78420/Documents/images/F2FDA5B9-B427-476F-BFA7-7FA8E2F8FF10.jpg', type: 'image/jpeg', name: 'photo.jpg' } }, operationName: null, mutationId: '1', extraReducers: [], updateQueries: {} }
But my server is working
The text was updated successfully, but these errors were encountered:
In the Apollo Client 2.0 version they removed the internal dependency on redux, so i won't be able to using the client.middleware anymore.
client.middleware
Sorry, something went wrong.
No branches or pull requests
Why do I get this error?
Error: Network error: Network request failed
My store
My backend here
My mutation:
My action:
after APOLLO_MUTATION_INIT - APOLLO_MUTATION_ERROR
But my server is working
![2017-12-01 20 28 17](https://user-images.githubusercontent.com/6774813/33495144-481d5252-d6d6-11e7-86c6-9a013965bd17.png)
The text was updated successfully, but these errors were encountered: