Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

RootValue is null #59

Open
SirwanAfifi opened this issue Apr 9, 2019 · 2 comments
Open

RootValue is null #59

SirwanAfifi opened this issue Apr 9, 2019 · 2 comments

Comments

@SirwanAfifi
Copy link

SirwanAfifi commented Apr 9, 2019

Thanks for this project!
I used the FileUpload types, mutations you provided on this project; I am using Apollo Client in my react application with the following configuration:

import { InMemoryCache } from "apollo-cache-inmemory";
import { ApolloLink } from "apollo-boost";
import ApolloClient from "apollo-client";
import { setContext } from "apollo-link-context";
import { createUploadLink } from "apollo-upload-client";

const authLink = setContext(async (_, { headers }) => {
   // auth link settings
});

const httpLink = createUploadLink({
  uri: "https://localhost:5001/graphql"
});
const cache = new InMemoryCache({
  dataIdFromObject: object => object.id
});
export const client = new ApolloClient({
  cache,
  link: ApolloLink.from([authLink, httpLink])
});

When I upload a file from my react application, RootValue gets null (var httpContext = (HttpContext)context.RootValue;). any idea?

@JuergenGutsch
Copy link
Owner

Hi @SirwanAfifi
Many thanks for this issue.
Would you create a small sample that can easily executed in the browser, please? That would help a lot to debug this behavior. Many Thanks :-)

@SirwanAfifi
Copy link
Author

@JuergenGutsch Thanks, I'll try to create a sample project 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants