I have a quick question please (not Graphcool 1.0)...
# prisma-whats-new
p
I have a quick question please (not Graphcool 1.0); if I have the following schema:
Copy code
type User @model {
id: ID! @isUnique
createdAt: DateTime!
updatedAt: DateTime!
jobs: [Job!]! @relation(name: "UserJobs")
}

type Job @model {
id: ID! @isUnique
createdAt: DateTime!
updatedAt: DateTime!
owner: User! @relation(name: "UserJobs")
criteria: [Criterion!]! @relation(name: "JobCriteria")
}

type Criterion @model {
id: ID! @isUnique
createdAt: DateTime!
updatedAt: DateTime!
title: String!
job: Job! @relation(name: "JobCriteria")
conditions: [Condition!]! @relation(name: "CriterionConditions")
}

type Condition @model {
id: ID! @isUnique
createdAt: DateTime!
updatedAt: DateTime!
title: String!
criterion: Criterion! @relation(name: "CriterionConditions")
}
…and I want to make sure that `User`s can only connect `Condition`s they create to their own `Job`s, is this permission correct:
Copy code
query ($user_id: ID!, $conditionsCondition_id: ID!) {
  SomeUserExists(filter: {
    AND: [
      { id: $user_id },
      {
        jobs_some: {
          criteria_some: {
            conditions_some: {
              id: $conditionsCondition_id
            }
          }
        }
      }
    ]
  })
}
Currently when I run
createCriterion
from the Playground, I get a
"code": 3008, "message": "No CONNECT permissions"
error.
p
Have you already implemented permissions in your ‘graphcool.yml’ config?
p
Yes, I can even see them on the console
p
- operation CriterionConditions.connect
Do you have one like this for the connection?
p
Yup, exactly
I actually think my permission is incorrectly written. No?
p
No, I think it’s a known bug for nested create queries. Had the same earlier this week, when the attribute connected in mandatory.
p
Oh!
p
If you test creating, then updating with the connection, it should work
Let me find the links
p
I can run both queries one after the other if that resolved it for you, in the same batch.
p
Oh boy, no… the conditions I have are actually created as an unbound array
In this case do you think I actually have to loop and create the query text manually?
p
I’m not sure
p
Thank you. Do you have an idea if I can use the result of one mutation to call another one just after it? I’m thinking of creating the criterion first then using its ID returned to create the conditions one by one…