cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

GraphQL error / Invalid input 'S': expected 't/T' or 'l/L'

malik
Node Clone

I'm trying to run a graphql query using neo4j-graphql jar plugin but am getting a really bizarre error I'm unable to track down.

Here's the error in plain text:

[GraphQL error]: Message: Exception while fetching data (/searchPodcast) : Invalid input 'S': expected 't/T' or 'l/L' (line 1, column 3 (offset: 2))
"CASE WHEN $content = '' THEN MATCH (n:Podcast) WHERE n.iTunesArtworkUrl600 IS NOT NULL RETURN n.LastModificationDate DESC, n.iTunesTrackCount DESC ELSE CALL db.index.fulltext.queryNodes('podcastSearch', $content) YIELD node WITH node as n RETURN n SKIP $offset LIMIT $limit END"
^, Location: [object Object], Path: searchPodcast

Any clues?

3 REPLIES 3

malik
Node Clone

Just found out that one can't do a MATCH inside a CASE. Will try to rewrite the logic but if someone has an idea as how to best reformat this, I'll be thankful.

malik
Node Clone

While trying to recreate the query with apoc's when:

searchPodcast(offset: Int = 0, limit: Int = 15, content: String!): [Podcast]
     @cypher(
      statement: """
      CALL apoc.when($content = "", 'MATCH (n:Podcast) WHERE n.iTunesArtworkUrl600 IS NOT NULL RETURN n.LastModificationDate DESC, n.iTunesTrackCount DESC', 'CALL db.index.fulltext.queryNodes(\'podcastSearch\', $content) YIELD node WITH node as n RETURN n', {content: $content})
      YIELD value
      RETURN value.n SKIP $offset LIMIT $limit
      """
	)

William_Lyon
Graph Fellow

Hey @malik - you've got some Cypher syntax errors in the queries used in the @cypher directive. I would suggest trying to run those queries in Neo4j Browser to get a better idea of where the Cypher syntax errors are so you can fix them.