lowip
10/17/2017, 4:34 PM# Comment
# - Schema
type Comment @model {
# Generated by server
id: ID! @isUnique
createdAt: DateTime!
updatedAt: DateTime!
# Data
text: String!
# - Relations
parent: Comment @relation(name: "CommentOnComment")
children: [Comment!]! @relation(name: "CommentOnComment")
author: User! @relation(name: "UserOnComment")
post: Post! @relation(name: "PostOnComment")
votes: [CommentVote!]! @relation(name: "CommentOnCommentVote")
}
And the following permission query on Comment.create
(inspired by https://docs-next.graph.cool/guides/auth/authorization-for-a-cms-miesho4goo#editors-can-only-assign-themselves-as-the-document-owner):
query isUser($user_id: ID!, $authorUser_id: ID!) {
SomeUserExists(filter: {
AND: [
{ id: $user_id },
{ id: $authorUser_id }
]
})
}
When running the following query (with the right auth token):
mutation create {
createComment(
text: "Waow, amazing",
authorId: "cj8tal6jg0pxv0192epmhlaha",
postId: "cj8vshelb01x601742ff1c0tt",
) {
id
}
}
I have the following error:
Permission Query is invalid. Could not be executed. Error Message: Error during variable coercion. Violations:\n\nVariable '$authorUser_id' expected value of type 'ID!' but value is undefined. Reason: Expected non-null value, found null. (line 1, column 29):\nquery isUser($user_id: ID!, $authorUser_id: ID!) {\n ^
Am I doing something wrong here?freder
10/17/2017, 4:38 PMrole
. so I have an enum:
enum UserRole {
ADMIN
USER
}
and a signup function that has a role
argument. however, I am encountering this message: "Schema Extension Error for function 'signup': Relations are currently not supported. Field 'role'"
will this be supported (soon)? + what's the workaround in the meantime? creating the user without a role first, and then doing another mutation?lastmjs
10/17/2017, 4:48 PMhumberto.cruz
10/17/2017, 4:51 PMhumberto.cruz
10/17/2017, 4:53 PMdivyendu
10/17/2017, 4:55 PM.graphcoolrc
? 😉Zak
10/17/2017, 5:55 PMlastmjs
10/17/2017, 6:06 PMassignment-lti-launch:
handler:
code:
src: ./functions/assignment-lti-launch/assignment-lti-launch.js
environment:
PRENDUS_LTI_SECRET: ${env:PRENDUS_LTI_SECRET}
type: resolver
schema: ./functions/assignment-lti-launch/assignment-lti-launch.graphql
amann
10/17/2017, 6:24 PMamann
10/17/2017, 6:24 PMmartin
10/17/2017, 6:37 PMgraphql-request
in a webtask? Worked yesterday, but today receiving a 400
error.
'use latest'
const { request } = require('graphql-request')
mwickett
10/17/2017, 7:27 PMgraphcool.yml
file? I”ve looked at https://github.com/graphcool/graphcool/tree/master/examples/env-variables-in-functions, but am wondering about having a single env variable used across multiple functions.diemol
10/17/2017, 7:36 PMdiemol
10/17/2017, 7:37 PMdiemol
10/17/2017, 7:38 PMdiemol
10/17/2017, 7:38 PMrwatts3
10/17/2017, 7:44 PMjohhansantana
10/17/2017, 8:01 PMrpeterson
10/17/2017, 9:56 PMrpeterson
10/17/2017, 10:01 PMlastmjs
10/17/2017, 10:56 PMlowip
10/17/2017, 11:23 PMlist
option for the permissions (https://github.com/graphcool/graphcool-json-schema/blob/master/src/schema.json#L105) but when running graphcool deploy
I have the following error:
Global
✖ unhandled error: Wrong operation defined for ModelPermission. You supplied: 'list'
Also, enumeration seems to be enabled for everyone by defaultauser
10/18/2017, 12:17 AMauser
10/18/2017, 12:21 AMauser
10/18/2017, 12:29 AMauser
10/18/2017, 12:29 AMmwickett
10/18/2017, 2:03 AM.graphcoolrc
level? Trying to setup staging and production graphcool instances, and I want to pass a different root URL (for an email sending function) depending on whether it’s staging or prod.wontwon
10/18/2017, 2:49 AMwontwon
10/18/2017, 3:08 AMwontwon
10/18/2017, 3:13 AM