Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 16 17:11
    dependabot[bot] labeled #386
  • May 16 17:11
    dependabot[bot] opened #386
  • May 16 17:11

    dependabot[bot] on npm_and_yarn

    build(deps): bump node-fetch fr… (compare)

  • May 16 11:02
    Resousse opened #385
  • May 10 13:42
    Resousse edited #384
  • May 10 13:26
    Resousse edited #384
  • May 10 13:24
    Resousse edited #384
  • May 10 13:23
    Resousse opened #384
  • May 03 13:57
    disintegrator edited #383
  • May 03 13:10
    adambaratz commented #374
  • May 03 11:07
    disintegrator commented #374
  • May 03 09:49
    disintegrator opened #383
  • Apr 28 19:55
    brianlenz commented #382
  • Apr 28 19:31
    brianlenz commented #382
  • Apr 28 18:24
    brianlenz commented #382
  • Apr 28 18:09
    brianlenz edited #382
  • Apr 28 18:06
    brianlenz commented #382
  • Apr 28 18:01
    brianlenz commented #382
  • Apr 28 17:43
    brianlenz edited #382
  • Apr 28 17:43
    brianlenz opened #382
Kristoffer
@stoffern
@omarkhaled11 create a issue on it. We are all on vacation at the moment so please be a little patient for a answer :wink:
omarkhaled11
@omarkhaled11
sure :) have fun guys!
Angel J Piscola
@Redmega
Hi guys, I have a productConnection within a category model, which is used to fetch the products belonging to that category. I am trying to add a filter in order ot filter by type, color, etc.. Having trouble figuring how out to do that. I have created a filter arg on the productConnection modeling the regexp one, which works if the query is 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' }) {
      }
    }
  }
}
I just get "unknown argument filter. did you mean after?"
Angel J Piscola
@Redmega
Btw happy vacation :)
Angel J Piscola
@Redmega
Update: Seems like if I hardcode nameregex in the productConnection relation, it works:
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 },
  }),
);
How can I then get the nameRegex val from the query on my jsx? I've seen examples where the entire filter is in the query but I would rather keep the _id operator in the relation itself.
Angel J Piscola
@Redmega
The issue I'm facing is I have the product connection related to Category as previously shared. On the product query I am not allowed to put a filter on the productConnection part of the query, because I have the filter in the productConnection filtering by _id. When I remove this filter I can place filter() on the productConnection part of the Category query, but then I lose the ability to filter by id
const extendedResolver = ProductTC
  .getResolver('connection')
  .addFilterArg({
    name: 'nameRegex',
    type: 'String',
    description: 'Filter by product id',
    query: (query, value, resolveParams) => { // eslint-disable-line
      query.name = new RegExp(value, 'i');
    },
  });
extendedResolver.name = 'connection';
ProductTC.addResolver(extendedResolver);
Angel J Piscola
@Redmega
I think I'll just move the _operators with _id to the query itself so I can use filter() in the query instead of only in the relationship
Angel J Piscola
@Redmega
Hey guys, faced another blocker trying to implement a custom input type. Maybe I'm doing it wrong?
I've got my custom type and extended resolver like so:
const SelectedAttributeType = InputTypeComposer.create(new GraphQLObjectType({
  name: 'SelectedAttribute',
  fields: () => ({
    group: { type: GraphQLString },
    values: { type: GraphQLList(GraphQLString) },
  }),
}));

const extendedResolver = ProductTC
  .getResolver('connection')
  .addFilterArg({
    name: 'attributeFilter',
    type: new GraphQLList(SelectedAttributeType.getType()),
    description: 'Filter by attribute groups',
    query: (query, value, resolveParams) => { // eslint-disable-line
      query.name = new RegExp(value, 'i');
    },
  });
extendedResolver.name = 'connection';
ProductTC.addResolver(extendedResolver);
This does not build, however, giving me: Error: SelectedAttribute fields must be an object with field names as keys or a function which returns such an object.
Removing the function and making it an object breaks it further, giving me the TypeError: Cannot call a class as a function error.
Anthony Ou
@Anthonyzou
the graphql 0.10.0 update seems to break things
also you should consider a donate button. This is really cool!
NiklasN
@Strutsagget
Hello, where should i start reading in docs about prepopulating query fields from auth user
if i got req.user populated from express-jwt.
Nick Parsons
@nparsons08
Hey there, new to the project and looking for some help provided the lack of documentation. I'm migrating from a RESTful API with several endpoints. Anyone available to point me in the right direction for docs? Right now I believe I have everything setup correctly, however, I cannot seem to get the darn GraphiQL UI to show me the Root Types.
I'm using the Northwind project as an example.
LG
@componentDidMount
Heyho, is someone having a good approach to protect specific mutations or queries, by lets say, something which is inside the req object when using graphql-compose with express-graphql?
maybe wrapping the resolvers would be the correct approach?
Jorge Cortes
@jcortes
Hello everyone, I'm new using graphql-compose-mongoose and I was wondering how can I create a relation between two models by reference using addRelation having in mind that in my mutation I would like to create the list of referenced documents too
Joshua Barnett
@joshua-barnett
Anyone know if its possible to implement my own fields alongside the ones created by graphql-compose?
Aaron Rumery
@bloodhawk
Hello guys, I've been working with a plugin associated with graphql-compose (https://github.com/graphql-compose/graphql-compose-elasticsearch). I've been using the ObjectTypeComposer from Elastic mapping for single indexes, but I'd like to be able to create a resolver that can hit multiple indexes and then use child GraphQL types per index. Has anyone done something like this? Using elasticApiFieldConfig I can wrap the entire ES API and do multi-index searches that way but then you sacrifice types as this resolver returns JSON as the type.
Ryan J. Peterson
@rpeterson
Trying to setup a basic example / use of graphql-compose-mongoose, keep running into Error: TypeError[.pageInfo]: Cannot convert to InputType the following value: ... - not sure if it's a known thing or I am just missing something obvious.
Nicolas Wild
@the-nicolas
Hi! Does anyone know where I can get support regarding some conceptional graphql-compose questions? Is there someone to hire?
Amarendra Kumar
@amarflybot
Does graphql-compose-elasticsearch supports graphql-compose-relay as of today ?
John Mikel Regida
@johnmikel
Hi everyone, awesome library. Just a question, does addRelation and addFields, when used consequently, throw an error? I am trying to do it but I am getting an error saying that the getResolver is undefined... anyone experiencing this?
German Smirnov
@ledamint

Hi, all.
Could you help why in my Mongoose schema property is required but it generates as optional property in graphQL schema?

const categoryScheme = new Schema(
    {
        name: {
            type: String,
            required: true,
            unique: true,
            maxlength: 120,
        },
// ..
type Category {
    _id: MongoID!
    createdAt: Date
    images: [String]
    name: String
    updatedAt: Date
}

name should be with ! in the end name: String!

Brandon Might
@bmight
Hey. I am a bit new to graphql. I am using graphql-compose-mongoose and I have two mongoose models setup. Example: Owner / Pet. The owner can have multiple pets and the pet has one owner. When you setup the relationship with graphql-compose-mongoose it requires you to have subfields for the relationship. Is it possible to get just the mongo id if you don't provide any subfields? Example below:
query  {
    petMany {
         name
         owner
   }
}
// vs
query  {
    petMany {
         name
         owner {
              _id
        }
   }
}