graphql-compose / graphql-compose/graphql-compose-elasticsearch
ES results return a existing graphQL Object Type
- Dominant language
- TypeScript
- Stars
- 584
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Description
I'm successfully getting responses via GraphQL from elastic search (great, thank you!). The results that I get back from ES via graphQL contain data from our user model that we've uploaded into ES.
Ideally I would love to have a query endpoint on graphQL that returns our userObjectType, instead of the elastic data I've pasted below/
Is it possible to map the results I'm getting back from ES via graphql and instead lookup and return a userObjectType?
```javascript
{
"data": {
"elastic": {
"search": {
"took": 18,
"timed_out": false,
"_shards": {
"total": 10,
"successful": 10,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.2876821,
"hits": [
{
"_index": "users",
"_type": "user",
"_id": "XXnLi2UBTapVJORUwH3i",
"_score": 0.2876821,
"_source": {
"id": "42c54556-45c2-4deb-9b87-868ea41cc5ef",
"preferredUsername": "omg",
"nickname": "OmarG",
"firstName": "Omar",
"lastName": "Goodfrey"
}
}
]
}
}
}
}
}
```
I'm new to GraphQL, so apologies if this is a bad question.
```
"elasticsearch": "^15.1.1",
"graphql": "^0.13.2",
"graphql-compose": "^4.8.2",
"graphql-compose-elasticsearch": "^1.10.1",
"graphql-relay": "0.5.5",
"graphql-sequelize": "8.3.1"
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.