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

@gramps/data-source-base

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gramps/data-source-base - npm Package Compare versions

Comparing version 1.0.0-beta.1 to 1.0.0

dist/context.js

82

package.json

@@ -1,81 +0,1 @@

{
"name": "@gramps/data-source-base",
"description": "Base modules for a GrAMPS GraphQL data source.",
"contributors": [
"Jason Lengstorf <jason@lengstorf.com>"
],
"repository": {
"type": "git",
"url": "https://github.com/gramps-graphql/data-source-base.git"
},
"main": "dist/index.js",
"directories": {
"test": "test"
},
"files": [
"dist/"
],
"scripts": {
"prepush": "npm test",
"prebuild": "del-cli ./dist",
"build": "babel src -d dist",
"dev": "gramps dev --data-source .",
"dev:mock-data": "gramps dev --data-source . --mock",
"lint": "eslint src/",
"test:unit": "NODE_ENV=test jest --coverage",
"test": "npm run lint --silent && npm run test:unit --silent",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"keywords": [
"graphql"
],
"license": "MIT",
"dependencies": {
"casual": "^1.5.19"
},
"peerDependencies": {
"graphql": "^0.9.0 || ^0.10.0 || ^0.11.0",
"graphql-tools": "^1.2.1 || ^2.5.1"
},
"devDependencies": {
"@gramps/cli": "^1.0.0-beta.4",
"@gramps/gramps": "^1.0.0-beta-7",
"babel-cli": "^6.24.1",
"babel-eslint": "^8.0.3",
"babel-jest": "^21.2.0",
"babel-plugin-inline-import": "^2.0.6",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-2": "^6.24.1",
"del-cli": "^1.1.0",
"eslint": "^4.13.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-prettier": "^2.4.0",
"graphql": "^0.11.7",
"graphql-tools": "^2.13.0",
"husky": "^0.14.3",
"jest": "^21.2.1",
"nodemon": "^1.13.3",
"prettier": "^1.9.2",
"semantic-release": "^8.2.0"
},
"jest": {
"coverageReporters": [
"text",
"lcov"
],
"collectCoverageFrom": [
"src/**/*.js"
],
"coverageThreshold": {
"global": {
"branches": 80,
"functions": 80,
"lines": 80,
"statements": 80
}
}
},
"version": "1.0.0-beta.1"
}
{"name":"@gramps/data-source-base","description":"Base modules for a GrAMPS GraphQL data source.","contributors":["Jason Lengstorf <jason@lengstorf.com>"],"repository":{"type":"git","url":"https://github.com/gramps-graphql/data-source-base.git"},"main":"dist/index.js","directories":{"test":"test"},"files":["dist/"],"scripts":{"prepush":"npm test","prebuild":"del-cli ./dist","build":"babel src -d dist","dev":"gramps dev --data-source .","dev:mock-data":"gramps dev --data-source . --mock","lint":"eslint src/","test:unit":"cross-env NODE_ENV=test jest --coverage","test":"npm run lint --silent && npm run test:unit --silent","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"keywords":["graphql"],"license":"MIT","dependencies":{"casual":"^1.5.19"},"peerDependencies":{"graphql":"^0.9.0 || ^0.10.0 || ^0.11.0","graphql-tools":"^1.2.1 || ^2.5.1"},"devDependencies":{"@gramps/cli":"^1.0.0-beta.4","@gramps/gramps":"^1.0.0-beta-7","babel-cli":"^6.24.1","babel-eslint":"^8.0.3","babel-jest":"^21.2.0","babel-plugin-inline-import":"^2.0.6","babel-preset-env":"^1.6.1","cross-env":"^5.1.1","del-cli":"^1.1.0","eslint":"^4.13.1","eslint-config-airbnb-base":"^12.1.0","eslint-config-prettier":"^2.9.0","eslint-plugin-import":"^2.8.0","eslint-plugin-prettier":"^2.4.0","graphql":"^0.11.7","graphql-tools":"^2.13.0","husky":"^0.14.3","jest":"^21.2.1","prettier":"^1.9.2","semantic-release":"^8.2.0"},"jest":{"coverageReporters":["text","lcov"],"collectCoverageFrom":["src/**/*.js"],"coverageThreshold":{"global":{"branches":80,"functions":80,"lines":80,"statements":80}}},"version":"1.0.0"}

@@ -1,2 +0,2 @@

<img src="https://gramps-graphql.github.io/gramps-express/assets/img/gramps-banner.png" alt="GrAMPS · An easier way to manage the data sources powering your GraphQL server" width="450">
<a href="https://gramps.js.org/"><img src="https://gramps.js.org/assets/img/gramps-banner.png" alt="GrAMPS · An easier way to manage the data sources powering your GraphQL server" width="450"></a>

@@ -8,9 +8,9 @@ # GrAMPS GraphQL Data Source Base

- **Connector** — how to access the data source (e.g. a REST API)
- **Model** — methods to retrieve/modify data from the data source (e.g. a
CRUD wrapper)
- **Schema** — description for GraphQL to interpret the data (see the
- **Context** — an object with methods to retrieve/modify data from the data
source (e.g. a CRUD wrapper)
- **Schema** — type definitions for GraphQL to interpret the data (see the
[GraphQL docs on schemas](http://graphql.org/learn/schema/))
- **Resolvers** — functions to map the results of calls to model methods to
the schema
- **Mock Resolvers** — mock functions for offline development

@@ -36,4 +36,4 @@ Each file contains a `TODO` comment explaining the changes you’ll need to make to create a working data source.

```sh
# Clone the repo
git clone git@github.com:gramps-graphql/data-source-base.git data-source-YOUR_DATA_SOURCE_NAME
# Get a copy of the data source
npx degit gramps-graphql/data-source-base data-source-YOUR_DATA_SOURCE_NAME

@@ -43,5 +43,2 @@ # Move into it

# Change the remote repo
git remote set-url origin git@github.com:USER_OR_ORG/YOUR_REPO_NAME.git
# IMPORTANT: Make sure to edit the name, description, contributors, and

@@ -51,21 +48,27 @@ # repository fields in package.json

# Install dependencies
yarn install
yarn
# Start the dev server
yarn dev
```
### To Develop with Mock Data
You'll see a message with URLs for the GraphQL gateway and the [GraphQL Playground](https://github.com/graphcool/graphql-playground). Open the Playground link (usually http://localhost:8080/playground if you don’t already have something running on port 8080), then run a query:
Start the app with the following command:
```sh
# Develop with mock data
yarn mock-data
```graphql
{
getById(id: 123) {
id
name
lucky_numbers
}
}
```
### To Develop with Live Data
### To Develop with Mock Data
Once you’ve got your data source configured to load live data, you can enable live data in development:
Start the app with the following command:
```sh
# Develop with live data
yarn live-data
# Start the gateway with mock data
yarn dev --mock
```

@@ -75,2 +78,2 @@

Currently, there is no watch capability (PRs welcome!), so the service needs to be stopped (`control` + `C`) and restarted (`yarn [mock-data|live-data]`) to reflect new changes to the data source.
Currently, there is no watch capability (PRs welcome!), so the service needs to be stopped (`control` + `C`) and restarted (`yarn dev`) to reflect new changes to the data source.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc