![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
graphql-centaur
Advanced tools
Once you head down the centaur's path forever will it dominate your destiny.
Translate GraphQL to Anything and make it your one and only source of truth. It is named centaur because you need to generate resolvers with this CLI and then add some edits to make them custom.
CLI tool to generate MongoDB Stucco Database Resolvers in TypeScript from GraphQL Schema. Compatible with GraphQL Editor projects( Free and Paid Tiers). So the main goal is to provide interactive experience creating GraphQL as a service.
Right now in its early beginnings.
npm i -g graphql-centaur
npm i graphql-centaur
then use with npx for example or as a package.json
scrip.
Centaur is an interactive tool to create GraphQL Resolvers connected to MongoDB compatible with stucco hybrid Go and TypeScript backend( the core is a binary and you write in TS). To start using centaur navigate to your backend repository and run command
$ centaur
Available commands are:
init
- create new backend project compatible with stucco in js/ts. First it will ask you to configure your project and the source of schema. Next you can create resolvers for your GraphQL Schema.
code
- run Resolver generation. See below.
First time when you generate a resolver centaur
will also generate needed libraries for collections
, DB
, Utils
and graphql-zeus definitions
Given the following schema:
type Person{
firstName: String!
}
type Query{
people: [Person]!
}
schema{
query: Query
}
After chosing:
Query
people
CRUD
listFilter
It should generate TypeScript resolver placed in $src/Query/people.ts
import { FieldResolveInput, FieldResolveOutput } from "stucco-js";
import { PersonCollection } from "../db/collections";
import { DB } from "../db/mongo";
import { Utils } from "../Utils";
import { Person, ResolverType, ValueTypes } from "../graphql-zeus";
export const handler = async (): Promise<FieldResolveOutput> => {
const db = await DB();
const col = await db.collection(PersonCollection);
return Utils.CursorToGraphQLArray<Person>(
await col.find({}),
);
};
and append correct entries to stucco.json
file.
{
"resolvers":{
"Query.people":{
"resolve":{
"name":"lib/Query/people"
}
}
}
}
and after running stucco
your resolver should work out of the box.
Some resolver types however need little code to make them work the way you want.
Resolvers are split into following categories
Create an object in your database and return it
Update an object in your database and return it
List all objects of selected type
Get object by parameter from the database
Remove object from the database and return true
Pipe the arguments of the query as source for the next resolver
Simple Resolver you need to write
Rest proxy resolvers for pointing to existing REST APIs
Resolver that receives source from the parent resolver
The same as CRUD, but also use source
FAQs
GraphQL -> anything. Use GraphQL as your source of truth.
The npm package graphql-centaur receives a total of 1 weekly downloads. As such, graphql-centaur popularity was classified as not popular.
We found that graphql-centaur 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.