Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

pass custom query to composeWithElastic #100

Open
@karladler

Description

is it somehow possible to add custom queries to the elastic query already when defining the GraphQL objects? I wan't to add a filter to my query to retrieve only Users from elastic which have the flag isCustomer set. I couldn't find any doc for this. There seems to be an "opts" fields, but not sure how to use it.

const CustomerES = composeWithElastic({
 graphqlTypeName: 'UserES',
 elasticIndex: 'users',
 elasticType: '_doc',
 elasticMapping: properties,
 elasticClient,
 pluralFields: ['orders'],
 opts: {
 query: {
 isCustomer: true,
 },
 },
});

sorry if this question is stupid, I'm just starting GraphQL and elastic ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /