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.
faunadb-graphql-schema-loader
Advanced tools
Package to simplify uploading GraphQL Schema to FaunaDB
A lib with some helper functions to make uploading a schema to FaunaDB easier.
It allows you to combine multiple SDL strings and use extend type
.
const { importSchema } = require('faunadb-graphql-schema-loader')
const secret = process.env.FAUNADB_ADMIN_KEY
const schema = `
type Budget {
name: String!
owner: User! @relation
}
type User {
budget: Budget! @relation
name: String!
}
`
importSchema(secret, schema).then((res) => console.log(res))
importSchema
importSchema = (
faunadbKey: string,
schema: string,
mode: 'replace' | 'merge' | 'override' = 'replace',
endpoint: string = 'https://graphql.fauna.com'
) => Promise<string>
Takes a schema string and uploads that to the database with the provided Admin Key.
Parameters
faunadbKey
An Admin key for your databaseschema
An SDL schema stringmode
Import mode. Defaults to merge
.Returns a Promise for the response.body
from the http request.
See basic example
makeSchema
makeSchema = (typeDefs: string[]) => string
Takes a list of SDL schema strings and combines them. This allows for using extends
in your type definitions.
Parameters
typeDefs
Array of SDL schema stringsReturns A single SDL schema string.
NOTE: Since
0.2.0
, theextend
keyword is not necessary for theQuery
type when used in multiple schemas. Normally, multiple types would cause an error. However,makeSchema
will automatically addextend
if multiple instances oftype Query
are found. This is useful for creating reusable schema chunks without having to worry about which schema usestype Query
while all others areextend type Query
.
Any feedback is appreciated, and if folks see ways to make this into a useful and viable package, I will work to make it so! Please fill out a Github Issue if you see anything.
Thanks!
The MIT License (MIT)
FAQs
Package to simplify uploading GraphQL Schema to FaunaDB
The npm package faunadb-graphql-schema-loader receives a total of 0 weekly downloads. As such, faunadb-graphql-schema-loader popularity was classified as not popular.
We found that faunadb-graphql-schema-loader 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 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.