kratam
07/29/2018, 2:06 PMposts
query which is retrieved by an API call. The comments
field for every post
is retrieved by another API call, the requests are batched with dataloader. Is it possible to filter the returned posts
based on the comments
field (e.g. only return posts
with comments
)? My problem is that the comments
field is only available after I returned the promise from the posts
query. Is it possible to filter/transform the returned data after every related promises resolved?vacom
07/29/2018, 4:01 PMliquidautumn
07/29/2018, 6:59 PMajmakhl
07/30/2018, 3:04 AMabhiaiyer
07/30/2018, 3:38 AMabhiaiyer
07/30/2018, 3:38 AMabhiaiyer
07/30/2018, 3:38 AMajmakhl
07/30/2018, 4:07 AMabhiaiyer
07/30/2018, 4:07 AMabhiaiyer
07/30/2018, 4:08 AMabhiaiyer
07/30/2018, 4:08 AMajmakhl
07/30/2018, 4:09 AMabhiaiyer
07/30/2018, 4:09 AMmatus.congrady
07/30/2018, 8:58 AMmichieldewilde
07/30/2018, 9:55 AMquery factoriesQuery($accountId: ID!) {
factories(accountId: $accountId) {
...factoryFields
}
}
fragment factoryFields on Factory {
id
name
collections(orderBy: name_ASC) {
…collectionFields
}
toys(orderBy: name_ASC) {
…toyFields
}
categories(orderBy: name_ASC) {
...categoryFields
}
}
fragment toyFields on Toy {
id
name
category {
...categoryFields
}
}
fragment categoryFields on Category {
id
name
}
fragment collectionFields on Collection {
id
name
toys(orderBy: name_ASC) {
…toyFields
}
}
fragment toyFields on Toy {
id
name
category {
...categoryFields
}
}
fragment categoryFields on Category {
id
name
}
The backend is throwing the following error:
There can be only one fragment named "categoryFields".,There can be only one fragment named “toyFields”.,There can be only one fragment named "categoryFields".I’m guessing that this has something to do with graphql-tools.
michieldewilde
07/30/2018, 9:56 AMsteven
07/30/2018, 2:31 PM/status
endpoint on a graphql-yoga
project? I have one deployed in AWS and want to hook up a load balancer health check.liamdanielduffy
07/30/2018, 3:43 PMgenerated/prisma.graphql
file after running prisma deploy
?liamdanielduffy
07/30/2018, 3:44 PMprisma.yml
file to run graphql get-schema -p <my_project>
liamdanielduffy
07/30/2018, 3:44 PMliamdanielduffy
07/30/2018, 3:44 PMprisma.graphql
file present in my directory when the command finishesjames h
07/30/2018, 4:17 PMjames h
07/30/2018, 4:17 PMJoby Joseph
07/30/2018, 4:29 PMJoby Joseph
07/30/2018, 4:40 PMJoby Joseph
07/30/2018, 4:40 PM"errors": [
{
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"addSession"
],
"code": 5008,
"message": "software.amazon.awssdk.services.lambda.model.ResourceNotFoundException: Function not found: arn:aws:lambda:eu-west-1:484631947980:function:cj81hi46q03c30196uxaswrz2-add-session (Service: null; Status Code: 404; Error Code: ResourceNotFoundException; Request ID: 8746f037-9414-11e8-9b33-bd3c86f8b4fe)",
"requestId": "eu-west-1:simple:cjk8hcyms0ntw0130a8siwya3"
}
]
Joby Joseph
07/30/2018, 4:40 PMchrisbull
07/30/2018, 8:43 PMgeometry
stating # Type 'USER-DEFINED' is not yet supported.
.
Here is the SQL query and expected returned value of the column.
SELECT ST_AsGeoJSON(logs.geometry) FROM logs
{ type: "LineString", coordinates: [[-79.895893,40.445344],[-79.895914,40.44529]] }
if I don’t use ST_AsGeoJSON
I get a value with only A-Z0-9 characters, such as 010200000002000000CE3637A627FD...
That said, when using Prisma, I’d like for Prisma to extract the data by wrapping the query using ST_AsGeoJSON
so that it returns the object geometry: {type: String, coordinates:[[Float]]}
... instead of geometry: String
. I’m also trying to do this easily, with as little of ‘custom’ code as possible.
Does anyone have a solution or workaround that would solve my dilemma?
1. Do I need to need to pull the String and then using JS convert it on the frontend to the object?
2. Or is there a way to get Prisma to pass the query wrapper (eg ST_AsGeoJSON
) so that it returns the object automatically?
3. What do I need to use as type Geometry { type: String, coordinates: [[Float]] }
to get this to work? Right now it’s screaming at me as it doesn’t like the [[Float]]
and that Geometry doesn’t have any relationships in the database.
Any help is greatly appreciated! Thank youfaure
07/30/2018, 9:15 PMchrisbull
07/30/2018, 9:34 PMprisma deploy
if you’ve added any fields to your type object, it generates a new column in your table with a default value of null
. If you want to set a default value use { someValue: String! @default(value: 'somedefault')
. This is assuming you are not using an existing database and that “migrations: true” in your docker-compose.yml. If you are using an existing database migrations will be set to false (this is to protect your database from any changes to the existing tables).