New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gqb

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gqb - npm Package Compare versions

Comparing version

to
0.1.3

README.md

88

package.json
{
"name": "gqb",
"version": "0.1.2",
"description": "graphql schema builder",
"main": "lib/index.js",
"repository": "https://github.com/istarkov/gqb",
"author": "istarkov@gmail.com",
"license": "MIT",
"scripts": {
"build": "yarn run lint && yarn run build:lib",
"test": "jest",
"lint": "eslint src",
"prebuild:lib": "rm -rf lib/*",
"build:lib": "babel --ignore spec.js --out-dir lib src",
"prepublish": "yarn run build"
},
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-jest": "^18.0.0",
"babel-loader": "^6.2.10",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-external-helpers": "^6.18.0",
"babel-plugin-flow-react-proptypes": "^0.18.2",
"babel-plugin-transform-class-properties": "^6.19.0",
"babel-plugin-transform-flow-strip-types": "^6.21.0",
"babel-plugin-transform-object-rest-spread": "^6.20.2",
"babel-polyfill": "^6.22.0",
"babel-preset-latest": "^6.16.0",
"babel-preset-react": "^6.16.0",
"eslint": "^3.12.2",
"eslint-config-airbnb": "^13.0.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^2.0.2",
"eslint-plugin-react": "^6.8.0",
"graphql": "^0.9.1",
"graphql-tools": "^0.10.0",
"jest": "^18.1.0",
"rimraf": "^2.5.4"
},
"dependencies": {},
"peerDependencies": {
"graphql": "^0.9.1"
}
"name": "gqb",
"version": "0.1.3",
"description": "graphql schema builder",
"main": "lib/index.js",
"repository": "https://github.com/istarkov/gqb",
"author": "istarkov@gmail.com",
"license": "MIT",
"scripts": {
"build": "yarn run lint && yarn run build:lib",
"test": "jest",
"lint": "eslint src",
"prebuild:lib": "rm -rf lib/*",
"build:lib": "babel --ignore spec.js --out-dir lib src",
"prepublish": "yarn run build"
},
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-jest": "^18.0.0",
"babel-loader": "^6.2.10",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-external-helpers": "^6.18.0",
"babel-plugin-flow-react-proptypes": "^0.18.2",
"babel-plugin-transform-class-properties": "^6.19.0",
"babel-plugin-transform-flow-strip-types": "^6.21.0",
"babel-plugin-transform-object-rest-spread": "^6.20.2",
"babel-polyfill": "^6.22.0",
"babel-preset-latest": "^6.16.0",
"babel-preset-react": "^6.16.0",
"eslint": "^3.12.2",
"eslint-config-airbnb": "^13.0.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^2.0.2",
"eslint-plugin-react": "^6.8.0",
"graphql": "^0.9.1",
"graphql-tools": "^0.10.0",
"jest": "^18.1.0",
"rimraf": "^2.5.4"
},
"dependencies": {},
"peerDependencies": {
"graphql": "^0.9.1"
}
}

@@ -8,3 +8,3 @@ import { gqb, getResolvers } from '../';

type Query {
hello: String${
hello: String${ // field resolver source
() => 'World'

@@ -18,2 +18,30 @@ },

type Mutation {
setMessage(message: String): String${ // mutation source
(_, { message }) => `Mutated ${message}`
}
}
`;
const executableSchema = makeExecutableSchema(
getResolvers(schema)
);
const { data } = await graphql(
executableSchema,
'{ hello, pic(size: 20)}'
);
expect(data).toMatchSnapshot();
const { data: mutData } = await graphql(
executableSchema,
'mutation { setMessage(message: "Hello") }'
);
expect(mutData).toMatchSnapshot();
});
test('it supports schema inlining', async () => {
const mutations = gqb`
type Mutation {
setMessage(message: String): String${

@@ -25,2 +53,18 @@ (_, { message }) => `Mutated ${message}`

const queries = gqb`
type Query {
hello: String${
() => 'World'
},
pic(size: Int): String${
(_, { size }) => `pic size is: ${size}`
}
}
`;
const schema = gqb`
${queries}
${mutations}
`;
const executableSchema = makeExecutableSchema(

@@ -27,0 +71,0 @@ getResolvers(schema)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet