guille
02/13/2018, 9:09 PMguille
02/13/2018, 9:09 PMRamsay Lanier
02/13/2018, 9:53 PMRamsay Lanier
02/13/2018, 9:53 PMRamsay Lanier
02/13/2018, 9:53 PMruleCount
to return an aggregationRamsay Lanier
02/13/2018, 9:54 PMRamsay Lanier
02/13/2018, 9:55 PMmatic
02/13/2018, 10:00 PMinfo
parameter as the second argument of .query
count: {
fragment: `fragment LikesCount on Post { id }`,
resolve: async ({ id }, args, ctx: Context, info) => {
const likes = await ctx.db.query.likesConnection(
{ where: { post: { id } } },
` { aggregate { count } } `,
)
return likes.aggregate.count
}
},
Ramsay Lanier
02/13/2018, 10:03 PMpatstrz
02/13/2018, 11:20 PM> Building
> ✓ Installed 914 modules [12s]
> ▲ npm run build
> > test-ts-server@ build /home/nowuser/src
> > rimraf dist && tsc
> node_modules/graphql-yoga/dist/src/types.d.ts(6,37): error TS2307: Cannot find module 'graphql-subscriptions/dist/subscriptions-manager'. `
any ideas what to do with this? I’m using graphql-yoga version 1.2.4tbrannam
02/14/2018, 2:48 AMwithFilter
on top of a subscription const newLink = {
subscribe: (parent, args, ctx, info) => {
return ctx.db.subscription.link(
{ },
info,
)
},
}
tbrannam
02/14/2018, 2:50 AMsubscribe
expects an AsyncIterator result - so I've assumed that's what ctx.db.subscription.link
would dotbrannam
02/14/2018, 2:51 AMwithFilter((parent.....)
but this yields an error stating that next
isn't implemented - so I'm confusedtbrannam
02/14/2018, 2:52 AMjesper
02/14/2018, 2:59 AMMr.niko.la
02/14/2018, 5:05 AMMr.niko.la
02/14/2018, 5:05 AMMr.niko.la
02/14/2018, 5:05 AMMr.niko.la
02/14/2018, 5:06 AMuname -m
> /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-composeMr.niko.la
02/14/2018, 5:06 AMMr.niko.la
02/14/2018, 5:06 AMMr.niko.la
02/14/2018, 5:22 AMMr.niko.la
02/14/2018, 5:25 AMMr.niko.la
02/14/2018, 5:26 AMgihrig
02/14/2018, 8:42 AMgihrig
02/14/2018, 8:50 AMgihrig
02/14/2018, 8:52 AMI believeOK, I’ll move on then, ignoring this line. Thanks for the rapid reply 😄mutations are only covered in the following chaptervote
wallslide
02/14/2018, 11:02 AMgraphql-yoga
. Looking for insight on how to programmatically control if a field gets returned or not:
type Event {
id: ID!
adminOnlySecret: String
}
How do I write a resolver that returns/hides adminOnlySecret
using graphql-yoga
, depending on something like whether the person requesting the Event
is an admin or not?romshark
02/14/2018, 11:32 AMromshark
02/14/2018, 1:15 PMIntrospection must provide input type for arguments.
Queries do work fine, but there's no schema docs available, the schema introspection doesn't work. Just googled the error and didn't find anything useful...
any ideas what this might be caused by? Did the GQL standard change? Is it the library's fault? Or is it mine?