Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
cruddl-launchpad
Advanced tools
Readme
cruddl - create a cuddly GraphQL API for your database, using the GraphQL SDL to model your schema.
This TypeScript library creates an executable GraphQL schema from a model definition and provides queries and mutations to access a database. Currently, it supports the multi-model database ArangoDB.
npm install --save cruddle
Install ArangoDB and create a new database.
import { ArangoDBAdapter } from 'cruddl';
const db = new ArangoDBAdapter({
databaseName: 'databaseName',
url: 'http://root:@localhost:8529',
user: 'root',
password: ''
});
If you just want to explore the features, you can also use an in-memory database implementation - but don't use this for anything else.
import { InMemoryAdapter } from 'cruddl';
const db = new InMemoryAdapter();
Define your data model and create a project:
import { Project } from 'cruddl';
const project = new Project([{
name: 'schema.graphqls',
body: `
type Movie @rootEntity {
title: String
actors: Actor @relation
}
type Actor @rootEntity {
name: String
movies: Movie @relation(inverseOf: "actors")
}`
}, {
name: 'permission-profiles.json',
body: JSON.stringify({
permissionProfiles: {
default: {
permissions: [{
roles: ['users'],
access: 'readWrite'
}]
}
}
})
}]);
Then, create the GraphQL schema and serve it:
import { GraphQLServer } from 'graphql-yoga';
const schema = project.createSchema(db);
db.updateSchema(schema); // create missing collections
const server = new GraphQLServer({ schema, context: () => ({ authRoles: [ 'users' ]}) });
server.start(() => console.log('Server is running on http://localhost:4000/'));
See the modelling guide and the api documentation for details or clone this repository for a full featured example.
Although the feature set is already quite extensive, this project is still in active development. A number of regression tests helps to avoid unexpected changes in behavior, but they do not yet cover all cases. Documentation is relatively sparse and will be extended in the future. We aim to contribute to the ongoing developments regarding GraphQL database interfaces and might change our API to more closely match these of other implementations in the future.
FAQs
[![npm version](https://badge.fury.io/js/cruddl.svg)](https://npmjs.org/cruddl) [![Build Status](https://travis-ci.org/AEB-labs/cruddl.svg?branch=master)](https://travis-ci.org/AEB-labs/cruddl)
The npm package cruddl-launchpad receives a total of 9 weekly downloads. As such, cruddl-launchpad popularity was classified as not popular.
We found that cruddl-launchpad 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.