Andrii Los
01/24/2018, 6:29 PMschema.graphqls
and gave it to graphql.config.json
and it actually supported via plugin finally.
But problem is that simplified schema is too simple, so my queries are still half red, but Relay schema generation is Relay schema not Apollo one, so still, all my queries are red.
Any chances to get all those mutations info etc somehow automatically? I mean the same schema we have in schema slider menu at the right.develomark
01/24/2018, 7:24 PMgraphql-cli
to generate fragments from your schemas to use in queries. https://github.com/develomark/graphql-cli-generate-fragments. To install npm i graphql-cli-generate-fragments
. Slots right into the Prisma/GC workflow. Enjoy!bradrich
01/24/2018, 7:35 PMaveragePaymentAmount
. Can someone please help me with this? Google has failed me.harrisrobin
01/24/2018, 7:41 PMavg
aggregation yet, only count
. They are working on itharrisrobin
01/24/2018, 7:42 PMharrisrobin
01/24/2018, 7:42 PMjuicycleff
01/24/2018, 8:18 PMajmakhl
01/24/2018, 8:39 PMajmakhl
01/24/2018, 8:39 PMajmakhl
01/24/2018, 8:46 PMmatic
01/24/2018, 9:13 PMtype TicketScan @model {
id: ID! @isUnique
createdAt: DateTime!
updatedAt: DateTime!
ticket: Ticket! @relation(name: "TicketScanOnTicket")
event: ModeratedEvent! @relation(name: "ModeratedEventScanedTicket")
}
type ModeratedEvent @model {
id: ID! @isUnique
createdAt: DateTime!
updatedAt: DateTime!
user: User! @relation(name: "UserModeratedEvent")
event: Event! @relation(name: "EventModerator")
scannedTickets: [TicketScan!]! @relation(name: "ModeratedEventScanedTicket")
}
type Event @model {
id: ID! @isUnique
createdAt: DateTime!
updatedAt: DateTime!
name: String!
description: String!
speaker: String!
period: Int!
location: String!
numberOfAvailableTickets: Int!
thumbnail: String!
picture: String!
tickets: [Ticket!]! @relation(name: "EventTicket")
moderators: [ModeratedEvent!]! @relation(name: "EventModerator")
admins: [AdministeredEvent!]! @relation(name: "EventAdministrator")
}
type Ticket @model {
id: ID! @isUnique
createdAt: DateTime!
updatedAt: DateTime!
event: Event! @relation(name: "EventTicket")
attendee: Customer! @relation(name: "EventAttendee")
bill: [TicketBill!]! @relation(name: "TicketBillOnTicket")
scan: TicketScan @relation(name: "TicketScanOnTicket")
}
type User @model {
id: ID! @isUnique
createdAt: DateTime!
updatedAt: DateTime!
email: String! @isUnique
password: String!
role: UserRole @defaultValue(value: BLOCKED)
administeredEvents: [AdministeredEvent!]! @relation(name: "UserAdministeredEvent")
moderatedEvents: [ModeratedEvent!]! @relation(name: "UserModeratedEvent")
}
Permissions :
- operation: TicketScan.create
authenticated: true
query: permissions/scan.graphql
query permitScan($user_id: ID!, $input_eventId: ID!, $input_ticketId: ID!) {
SomeModeratedEventExists(filter: {
id: $input_eventId,
user: {
id: $user_id
},
event: {
tickets_some: {
id: $input_ticketId,
scan: null
}
}
})
}
Works if this permission is set to allow all, and I also can find an event matching the fields in Permissions tester
.hari mohan
01/24/2018, 9:20 PMmatic
01/24/2018, 9:22 PMquery.wishpoints
which allows you to use filter queries (not just id
filter query)hari mohan
01/24/2018, 9:25 PMmatic
01/24/2018, 9:27 PMname_contains
for example. Check out your schema docs in playground (web console, green notch on the right) 🙂hari mohan
01/24/2018, 9:28 PMmatic
01/24/2018, 9:37 PMMK
01/24/2018, 10:59 PMdonedgardo
01/24/2018, 11:26 PM.graphcoolrc
?elmir
01/24/2018, 11:29 PMveksen
01/25/2018, 3:41 AMmutation {
createProfile(userId: "cjcs1tv4k1ga60134mh799k7r") {
id
firstName
lastName
}
}
getting me the following error:
"Variable \"$_where\" got invalid value {\"user\":{\"id\":\"cjcs1tv4k1ga60134mh799k7r\"}}; Field \"user\" is not defined by type UserWhereInput."
the mutation itself is defined and copied like the Link/Vote from the Howtographql.com tutorials (hackernews clone):
type Mutation {
...
vote(linkId: ID!): Vote
createProfile(userId: ID!): Profile
}
I know this might not be the best place to ask about this, if so, please direct me to a better place 🙂agartha
01/25/2018, 3:46 AMveksen
01/25/2018, 3:48 AMveksen
01/25/2018, 3:49 AMagartha
01/25/2018, 3:52 AMNick Luger
01/25/2018, 4:20 AMvarun
01/25/2018, 5:54 AMGoutham
01/25/2018, 6:09 AMvarun
01/25/2018, 7:04 AMtrjstewart
01/25/2018, 7:13 AM