Skip to content

Implement util.validatePredicate #525

Open
@katarinasupe

Description

@katarinasupe

On mutation, you get the following error:

"Function 'apoc.util.validatePredicate' doesn't exist."

To reproduce, run the attached code. Open Apollo server on localhost:4000. Run the following code to create user nodes:

# Create a user
mutation {
  createUsers(input: 
  [ { 
    name: "katarina"
  }]
  
  ) {
    users {
      id,
      name
    }
  }
}

# Create multiple users
mutation {
  createUsers(input: 
  [ { 
    name: "matea"
  },
  {
    name: "ante"
  },
  {
    name: "gabor"
  }]
  
  ) {
    users {
      id,
      name
    }
  }
}

Then, try the following mutation (connectOrCreate requires @unique decorator - we didn't document this well enough; it might have been added to never version):

# Create a post
mutation {
  createPosts(input: 
  [ { 
    content: "hello world!",
    creator: {
      connectOrCreate: {
        where: { node: { id: "06daddb7-1657-4e6a-8a7d-b11ec6d2698f" } }
        onCreate: { node: { name: "katarina" } }
      }
    }
  }]
  
  ) {
    posts {
      id,
      content
    }
  }
}

The above mutation results in the reported error, instead of creating a post.

This was reported on Discord.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions