graphql-compose / graphql-compose/graphql-compose-elasticsearch

GraphQL Module Integration

Open
#84 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
584
Forks
76
PR merge metrics
No merged PRs in 30d

Description

Hi there. Really keen to try and integrate this awesome package with GraphQL Modules (https://graphql-modules.com/).

I'm wondering if you have any idea how to think about doing this? At the moment I have the below:

But I need to pass some kind of resolvers to the module...any thoughts? Or is this likely to be incompatible?

I think it's a case of swapping from using the graphqlHTTP method to modules...?
```
import { GraphQLModule } from '@graphql-modules/core';
import { graphql } from 'graphql-compose';
import { elasticApiFieldConfig } from 'graphql-compose-elasticsearch';

const { GraphQLSchema, GraphQLObjectType } = graphql;

const generatedSchema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Query',
fields: {
elastic70: elasticApiFieldConfig({
host: 'http://user:pass@localhost:9200',
apiVersion: '_default',
// log: 'trace',
}),
},
}),
});

export const elasticGraphQLModule = new GraphQLModule({
typeDefs: generatedSchema,
imports: [],
});

export default elasticGraphQLModule;
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.