cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

How to return all relements?

Hi

I was wondering if you can help me please

I would like to return all element, but currently it only returns one element:

This is my schema query:

type Query {
	likers: [User]
		@cypher(
			statement: """
                              MATCH(u1: User)-[:LIKES]->(u2: User)
                              RETURN u1,u2
			"""
		)
}

In the above example, I would like to return both u1 and u2, however the graphiql only returns u2:

query getLikers {
  likers {
    firstName
  }
}

returns:

{
  "data": {
    "LikeUser": [
      {
        "firstName": "user2"
      }
    ]
  }
}

Are you able to let me know what I am doing wrong please?

1 ACCEPTED SOLUTION

MuddyBootsCode
Graph Steward

Welcome to community! Do you by chance have your schema handy? It'd be easier to help if we can see how you've got the laid out in your GraphQL schema.

View solution in original post

2 REPLIES 2

MuddyBootsCode
Graph Steward

Welcome to community! Do you by chance have your schema handy? It'd be easier to help if we can see how you've got the laid out in your GraphQL schema.

Hi @MuddyBootsCode - thank you for getting back to me and I appreciate the warm welcome!

I spent some more time on this forum and realised that what I was trying to return was a tuple (and my schema was completely wrong - apologies, I am still very new to using this project)

This forum post explained the issue that I was retrying to resolve: GraphQL query returning list of objects