-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
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
networkInterface return an object rather than string for GraphQLRequest.query #637
Comments
https://github.com/apollostack/apollo-client/blob/a92631da86b2ae493625973447a02b1204a3059f/src/networkInterface.ts#L35 interface Request {
debugName?: string;
query?: Document; // this mismatch with graphql( ) from graphql package
variables?: Object;
operationName?: string;
[additionalKey: string]: any;
} |
Well, I use const REST2GraphQLInterface = {
query(GraphQLRequest) {
return graphql(
executableSchema, // schema: GraphQLSchema
printAST(GraphQLRequest.query), // requestString: string
undefined, // rootValue?: ?any
{ // contextValue?: ?any,
Config: new Config({ connector: serverConnector }),
User: new User({ connector: serverConnector }),
PowerEntity: new PowerEntity({ connector: serverConnector }),
FortuneCookie: new FortuneCookie(),
},
GraphQLRequest.variables, // variableValues?: ?{[key: string]: any}
undefined // operationName?: ?string
);
}
}; It works! |
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As #379 ,
The
query
receive from ApolloClient is mismatching the second argument of graphql( ) , becausequery
is now anObject {kind: "Document", definitions: Array[1]}
.But as document read
query
is just a string.I tried to remove
addQueryMerging( )
andfrom
new ApolloClient({ })
but
query
still being an object.The text was updated successfully, but these errors were encountered: