dependabot[bot] on npm_and_yarn
build(deps): bump node-fetch fr… (compare)
Hmm, that still has the problems we saw above with toDottedObject although, in the example, you have
resolveParams.args = {
$and: [
{ "a": 1 }
{ "$or": [
"b": 2,
"c": 2
]}
]
}
and i think that would have to be
resolveParams.args.filter = {
$and: [
{ "a": 1 }
{ "$or": [
"b": 2,
"c": 2
]}
]
}
using the example of real data sending in a query such as
{
'$and': [
{
'$comment': '{"criterionLabel":"A","criteriaPath":["statement","actor"]}',
'$or': [
{
'statement.actor.account.homePage': 'http://beta.curatr3.com',
'statement.actor.account.name': 'e9fb7843-6958-432e-829e-09a3255d897c'
},
{
'statement.actor.account.homePage': 'http://beta.curatr3.com',
'statement.actor.account.name': '91091d5d-551d-479c-a349-b1fb3b87bb09'
}
]
}
]
}
I get an output query of
{
'$and.$and.0.$comment': '{"criterionLabel":"A","criteriaPath":["statement","actor"]}',
'$and.$and.0.$or.0.statement.actor.account.homePage': 'http://beta.curatr3.com',
'$and.$and.0.$or.0.statement.actor.account.name': 'e9fb7843-6958-432e-829e-09a3255d897c',
'$and.$and.0.$or.1.statement.actor.account.homePage': 'http://beta.curatr3.com',
'$and.$and.0.$or.1.statement.actor.account.name': '91091d5d-551d-479c-a349-b1fb3b87bb09'
}
User.find({
'$or':[
{firstname:new RegExp(searchText,'i')},
{lastname:new RegExp(searchText,'i')},
{email:new RegExp(searchText,'i')}
]});
})
GQC.rootQuery().addFields({
city: CityTC.get('$findOne'),
cityConnection: CityTC.get('$connection'),
currentTime: {
type: 'Date',
resolve: () => Date.now(),
},
// ...
});
GQC.rootMutation().addFields({
createCity: CityTC.get('$createOne'),
updateCity: CityTC.get('$updateById'),
// ...
});
get
calls resolved? Where is e.g. $createOne
defined? Is this a mongoose method?
Hi, everyone
I need a help.
So, I have a Shema
const UserSchema = new Schema({
name: String,
gender: {
type: String,
enum: ['male', 'female', 'ladyboy'],
},
city: String
},
{
collection: 'users'
});
const User = mongoose.model('User', UserSchema);
const UserTC = composeWithRelay(composeWithMongoose(User));
...
I have add new field
UserTC.addFields({
foo: {
type: GraphQLString,
projection: { test: true, gender: true },
resolve: (source) => (`${source.test} ${source.gender}`)
},
})
And I would like add another field depended from foo field
UserTC.addFields({
bar: {
type: GraphQLString,
projection: { foo: true },
resolve: (source) => (`${source.foo} is awesome`) // but source.foo is undefined
},
})
But source.foo is undefined. What should I do for fix it ?
Thanks
UserTC.addFields({
foo: {
type: GraphQLString,
projection: { test: true, gender: true },
resolve: (source) => (`${source.test} ${source.gender}`)
},
bar: {
type: GraphQLString,
projection: { foo: true },
resolve: (source) => (`${source.foo} is awesome`) // but source.foo is undefined
},
})
viewer { productConnection(filter: blah) { etc } }
, but I am unable to put it on my embedded connection like so:query {
viewer {
category {
...
productConnection(filter: { nameRegex: 'blah' }) {
}
}
}
}
"unknown argument filter. did you mean after?"
CategoryTC.addRelation(
'productConnection',
() => ({
resolver: ProductTC.getResolver('connection'),
args: {
filter: (source) => ({
_operators: { // eslint-disable-line no-underscore-dangle
_id: { in: source.products }, // eslint-disable-line no-underscore-dangle
},
nameRegex: 'plat',
}),
sort: { sortOrder: 1 },
},
projection: { products: true },
}),
);
filter
is in the query but I would rather keep the _id operator in the relation itself.