Closed iamalvisng closed 6 years ago
check your version of react-apollo, if it is the version 2 you need to change the code, check the migrations of this new version, or just install the react-apollo 1.4 version
You need to:
import gql from 'graphql-tag';
This issue is outdated. Please open a new issue if you have any problems or questions.
I am getting the same error even when I am importing it from graphql-tag.
import { gql } from "graphql-tag";
const projectsQuery=gql { projects { id name description image contributors { name } resources { title url } } }
export {projectsQuery};
The error is
@highskillzz - import gql from 'graphql-tag';
graphql-tag
doesn't have a named export. They have a default export.
After you replace the import, if you don't get a new error or it's still not working, try restarting webpack. After that, if you still have an issue, shoot a code block on here with your whole file and a code block with the complete error + stack trace. (Not a screenshot.)
Yeah, that solved it. Thanks @iamclaytonray
I was trying to follow the tutorial for the authentication at https://www.graph.cool/docs/tutorials/auth/authentication-with-facebook-for-react-and-apollo-yi9jeuwohl#getting-started.
Unfortunately, I am stuck in the step 18, where I see the error as such:
Has anyone bumped into this error and managed to resolve it?
This is my
App.js
: