Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
elasticsearch-graphql
Advanced tools
Schema and query builder for Elastic Search
Disclaimer: This is a proof of concept. All features are working but bugs will appear. Contact me on github for any issue and I'll look in to it
var graphql = require('graphql');
var esGraphQL = require('elasticsearch-graphql')
var hitsSchema = require('./schemas/myGraphQLSchema')
esGraphQL({
graphql: graphql,
name: 'ordersSearch',
elastic: {
host: 'localhost:9200',
index: 'orders',
type: 'order'
},
hitsSchema: hitsSchema
},function(err, schema) {
var rootSchema = new graphql.GraphQLSchema({
query: new graphql.GraphQLObjectType({
name: 'RootQueryType',
fields: {
mySearchData: {
type: schema.type,
args: schema.args,
resolve: schema.resolve
}
}
})
})
})
It will fetch the current mapping from elasticsearch and create a static typed schema for you. Add the schema to you graphql server and the type helper will lead you. The hits field will resolve to whatever schema you send in. So you can use elasticsearch for searching data and then easily get your real data from anywhere. See full example in in /examples
{
ordersSearch(query: "New Order",
filters: {
images: {
createdBy: {
values: ["Simon Nord", "James Kyburz"],
operator: OR
}
}
}
) {
aggregations {
status {
timestamp(limit: 5) {
unhandledDocs
buckets {
key,
count
}
}
}
}
hits {
id
}
}
}
[ ] Do smarter elasticsearch queries [ ] Add more options, like query type etc. [ ] Add tests [ ] Allow more aggregation types [ ] Allow more complex filters
FAQs
Schema generator and query builder for elasticsearch
The npm package elasticsearch-graphql receives a total of 19 weekly downloads. As such, elasticsearch-graphql popularity was classified as not popular.
We found that elasticsearch-graphql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.