timwis
05/18/2018, 10:26 AMltree
?senorcodecat
05/18/2018, 11:39 AMryannealmes
05/18/2018, 11:41 AMrein
05/18/2018, 11:55 AMconst server = new GraphQLServer({
typeDefs: './src/schema.graphql',
resolvers,
fieldMiddleware: [algoliaMiddleware],
context: req => ({ ...req, db }),
});
this makes my server crash, saying fieldMiddleware is not a valid property, but thats what the documentation provides as boilerplaterein
05/18/2018, 11:57 AMmiddlewares
, might have to update the docs of graphql-middlewarematic
05/18/2018, 12:18 PMfieldMiddleware
to middlewares
. Yoga’s docs was in sync but we must have forgotten to update this one as well. Thanks again!Christian
05/18/2018, 12:21 PMconst companyQuery = `
{
company {
id
}
}
`
export const companies = {
async company(parent, args, ctx: Context, info) {
const userId = getUserId(ctx)
const userCompanyId = await ctx.db.query.user(
{ where: { id: userId } },
companyQuery,
)
return ctx.db.query.company(
{ where: { id: userCompanyId.company.id } },
info,
)
},
}
I would like to get the Company data directly with the user query though, but for this I need to transform the info object (wrapping the SelectionSet for a Company into one suitable for User)... what is the best way to do this?rpeterson
05/18/2018, 12:54 PMRenyuan
05/18/2018, 2:27 PMnoahdavis
05/18/2018, 2:37 PMweakky
05/18/2018, 4:09 PMhez
05/18/2018, 7:28 PMbartimaeus
05/18/2018, 8:07 PMJulian
05/18/2018, 8:22 PMVariable "$answers" of type "AnswerCreateManyWithoutQuestionInput" used in position expecting type "[AnswerCreateWithoutQuestionInput!]
emrah
05/18/2018, 11:43 PMrein
05/19/2018, 9:46 AMclaudiu.ceia_1
05/19/2018, 10:36 AMterion
05/19/2018, 1:19 PMtimwis
05/19/2018, 3:30 PMzonofthor
05/19/2018, 4:08 PMphilch
05/19/2018, 5:02 PMdennisko
05/19/2018, 6:16 PMdennisko
05/19/2018, 6:18 PMAubron Wood (ScoreShots)
05/19/2018, 7:24 PMcsamu
05/19/2018, 11:19 PMMichael Jones
05/19/2018, 11:53 PMSam Jackson
05/20/2018, 12:30 AMunion Content = Post | Comment
interface ContentInterface {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
author: User!
body: String!
}
type Post implements ContentInterface {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
author: User!
body: String!
comments: [Comment!]!
}
type Comment implements ContentInterface {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
author: User!
body: String!
parent: Content!
}
type User {
id: ID! @unique
email: String! @unique
password: String!
name: String!
posts: [Post!]!
content: [Content!]!
}
HarryC
05/20/2018, 4:00 AMHarryC
05/20/2018, 4:02 AMuser
05/20/2018, 4:02 AM