Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@dialexa/pleco-graphql
Advanced tools
This library provides GraphQL types that can be used to form your own filter types
All the GraphQL types can be found in src/graphql/index.ts
. For each GraphQLScalarType
(excluding Boolean
),
which includes ID
, Int
, String
, and Float
, we provide a GraphQL type
allowing users to provide comparison operations like in
, lt
, gt
, eq
, as well as the nesting
abilities with AND
and OR
.
operation | FilterQuery_Boolean | FilterQuery_ID | FilterQuery_String | FilterQuery_Int | FilterQuery_Float |
---|---|---|---|---|---|
AND | ✔ | ✔ | ✔ | ✔ | ✔ |
OR | ✔ | ✔ | ✔ | ✔ | ✔ |
in | ✔ | ✔ | ✔ | ✔ | ✔ |
nin | ✔ | ✔ | ✔ | ✔ | ✔ |
eq | ✔ | ✔ | ✔ | ✔ | ✔ |
ne | ✔ | ✔ | ✔ | ✔ | ✔ |
gt | ✔ | ✔ | ✔ | ||
lt | ✔ | ✔ | ✔ | ||
gte | ✔ | ✔ | ✔ | ||
lte | ✔ | ✔ | ✔ | ||
contains | ✔ |
In addition to the 4 FilterQuery_*
types, pleco-graphql also provides
SortDirection
: an enum of ASC
and DESC
LimitOffsetPage
: an input object with limit and offsetgraphQLTypes
which is a string containing the definitions of all the types in SDL.All these exports were written using what they will appear as in SDL. The javascript objects are:
SDL Name | Javascript Export |
---|---|
FilterQuery_Boolean | GraphQLFilterQueryBoolean |
FilterQuery_ID | GraphQLFilterQueryID |
FilterQuery_String | GraphQLFilterQueryString |
FilterQuery_Int | GraphQLFilterQueryInt |
FilterQuery_Float | GraphQLFilterQueryFloat |
SortDirection | GraphQLSortDirection |
LimitOffsetPage | GraphQLLimitOffsetPage |
null
can be passed to eq
and ne
and will do a whereNull
and whereNotNull
, respectivelycontains
is case insensitiveTake the following GraphQL schema
type Vehicle {
make: String
model: String
}
input VehicleFilterInput {
AND: [VehicleFilterInput]
OR: [VehicleFilterInput]
"fields on the vehicle table"
make: FilterQuery_String
model: FilterQuery_String
"fields not directly on the vehicle table"
numberOfUsers: FilterQuery_Int
highwayMPG: FilterQuery_Int
cityMPG: FilterQuery_Int
userSurveyRating: FilterQuery_Float
}
input VehicleSortInput {
numberOfUsers: SortDirection
userSurveyRating: SortDirection
}
type Query {
vehicles(filter: VehicleFilterInput, sort: VehicleSortInput): [Vehicle]
}
Using this input, a user could construct the following filter query:
query GetVehicles ($filter: VehicleFilterInput, $sort: VehicleSortInput) {
vehicles (filter: $filter, sort: $sort) {
make
model
}
}
with variables
{
"filter": {
"AND": [
{ "make": { "eq": "nissan" } },
{ "model": { "in": ["altima", "sentra"] } },
{ "numberOfUsers": { "AND": [{ "gt": 1000 }, { "lt": 1999 }] } },
{
"OR": [
{ "highwayMPG": { "gt": 30 } },
{ "cityMPG": { "gte": 20 } }
]
},
{ "userSurveyRating": { "gte": 80.5 } }
]
},
"sort": {
"userSurveyRating": "ASC"
}
}
This will specify that the user wants all vehicles whose make is "nissan", with model "altima" or "sentry", who has between 1000-1999 users (exclusive), whose user survey ratings is greater than or equal to 80.5 and whose MPG satisifies either highway strictly greater than 30mpg or city greater than or equal to 20mpg, and sorted by userSurveyRating ascending.
FAQs
# Pleco GraphQL
The npm package @dialexa/pleco-graphql receives a total of 1 weekly downloads. As such, @dialexa/pleco-graphql popularity was classified as not popular.
We found that @dialexa/pleco-graphql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.