Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
This package allows you to injects type resolvers directly into GraphQL schema language.
A lot of boilerplate code if write schemas on javascript graphql-js.
This is better graphql-tools but resolvers described after the schema.
Using tagged template literals we can place resolvers directly inside schema.
import { gqb, getResolvers } from 'gqb';
import { graphql } from 'graphql';
import { makeExecutableSchema } from 'graphql-tools';
const schema = gqb`
type Query {
hello: String${ // field resolver source
() => 'World'
},
pic(size: Int): String${
(_, { size }) => `pic size is: ${size}`
}
}
type Mutation {
setMessage(message: String): String${ // mutation source
(_, { message }) => `Mutated ${message}`
}
}
`;
const executableSchema = makeExecutableSchema(
getResolvers(schema)
);
graphql(
executableSchema,
'{ hello, pic(size: 20)}'
)
.then(response => console.log(response));
Type fields resolver now are placed directly in the schema, immediatelly after type!!!
It also supports schema inlining, (see tests)
See the source it's small.
FAQs
graphql schema builder
We found that gqb 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.