Error with gql tag
When I try to run my request with
console.log(loadBoards.kind)
console.log('loadBoards.kind')
export default compose(connect(_mapStateToProps), graphql(loadBoards, { name: 'loadBoards' }))(BoardList)
I get the following error
Network error: Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag?
Here is my definition of the query
const loadBoards = gql
query($boardName:String,$boardId:String){
boards(boardName:$boardName,boardId:$boardId){
boardName id ratingAmount ratingScore
}
}
``
@eedfa is this still an issue for you?
Trying to clean up your question:
const loadBoards = gql
query($boardName:String,$boardId:String) {
boards(boardName:$boardName,boardId:$boardId) {
boardName id ratingAmount ratingScore
}
}
Should be:
const loadBoards = gql`
query($boardName:String,$boardId:String) {
boards(boardName:$boardName,boardId:$boardId) {
boardName id ratingAmount ratingScore
}
}
`;
Notice the ` that denotes template strings
I have them.Still have the problem.
Please submit questions to the slack channel or stack overflow. We need to keep this tracker focused on actionable issues.