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

elasticType is no longer used in ElasticSearch, but unable to un-set

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

Description

```
const ReservationsESTC = composeWithElastic({
graphqlTypeName: 'ReservationsES',
elasticIndex: 'reservations',
elasticMapping: reservationMapping,
elasticType: 'reservations',
elasticClient: new elasticsearch.Client({
host: 'http://localhost:9200',
apiVersion: '7.7',
log: 'trace',
}),
// elastic mapping does not contain information about is fields are arrays or not
// so provide this information explicitly for obtaining correct types in GraphQL
pluralFields: ['reviews', 'places', 'cities'],
});

```

Results in this type of post request:

```
POST http://localhost:9200/reservations/_search?type=reservations&q=Boulevard
{
"explain": true,
"version": true,
"_source": false,
"track_scores": true
}

```

But `type=...` is no longer supported in ES (7.13)

`#! [types removal] Specifying types in search requests is deprecated.`

And results in 0 hits, while removeing the type parameter makes it work fine

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.