Gathering detailed insights and metrics for graphql
Gathering detailed insights and metrics for graphql
Gathering detailed insights and metrics for graphql
Gathering detailed insights and metrics for graphql
@opentelemetry/instrumentation-graphql
OpenTelemetry instrumentation for `graphql` gql query language and runtime for GraphQL
@graphql-tools/graphql-tag-pluck
Pluck graphql-tag template literals
@octokit/graphql
GitHub GraphQL API client for browsers and Node
@graphql-tools/documents
Utilities for GraphQL documents.
A reference implementation of GraphQL for JavaScript
npm install graphql
99.4
Supply Chain
100
Quality
98.6
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
20,100 Stars
3,188 Commits
2,027 Forks
399 Watching
31 Branches
195 Contributors
Updated on 27 Nov 2024
Minified
Minified + Gzipped
TypeScript (92.46%)
MDX (4.59%)
JavaScript (2.45%)
CSS (0.42%)
Shell (0.07%)
Cumulative downloads
Total Downloads
Last day
-8.7%
2,583,866
Compared to previous day
Last week
0.9%
14,698,093
Compared to previous week
Last month
9.2%
62,029,797
Compared to previous month
Last year
16.7%
634,642,612
Compared to previous year
No dependencies detected.
The JavaScript reference implementation for GraphQL, a query language for APIs created by Facebook.
See more complete documentation at https://graphql.org/ and https://graphql.org/graphql-js/.
Looking for help? Find resources from the community.
A general overview of GraphQL is available in the README for the Specification for GraphQL. That overview describes a simple set of GraphQL examples that exist as tests in this repository. A good way to get started with this repository is to walk through that README and the corresponding tests in parallel.
Install GraphQL.js from npm
With npm:
1npm install --save graphql
or using yarn:
1yarn add graphql
GraphQL.js provides two important capabilities: building a type schema and serving queries against that type schema.
First, build a GraphQL type schema which maps to your codebase.
1import { 2 graphql, 3 GraphQLSchema, 4 GraphQLObjectType, 5 GraphQLString, 6} from 'graphql'; 7 8var schema = new GraphQLSchema({ 9 query: new GraphQLObjectType({ 10 name: 'RootQueryType', 11 fields: { 12 hello: { 13 type: GraphQLString, 14 resolve() { 15 return 'world'; 16 }, 17 }, 18 }, 19 }), 20});
This defines a simple schema, with one type and one field, that resolves
to a fixed value. The resolve
function can return a value, a promise,
or an array of promises. A more complex example is included in the top-level tests directory.
Then, serve the result of a query against that type schema.
1var source = '{ hello }'; 2 3graphql({ schema, source }).then((result) => { 4 // Prints 5 // { 6 // data: { hello: "world" } 7 // } 8 console.log(result); 9});
This runs a query fetching the one field defined. The graphql
function will
first ensure the query is syntactically and semantically valid before executing
it, reporting errors otherwise.
1var source = '{ BoyHowdy }'; 2 3graphql({ schema, source }).then((result) => { 4 // Prints 5 // { 6 // errors: [ 7 // { message: 'Cannot query field BoyHowdy on RootQueryType', 8 // locations: [ { line: 1, column: 3 } ] } 9 // ] 10 // } 11 console.log(result); 12});
Note: Please don't forget to set NODE_ENV=production
if you are running a production server. It will disable some checks that can be useful during development but will significantly improve performance.
The npm
branch in this repository is automatically maintained to be the last
commit to main
to pass all tests, in the same form found on npm. It is
recommended to use builds deployed to npm for many reasons, but if you want to use
the latest not-yet-released version of graphql-js, you can do so by depending
directly on this branch:
npm install graphql@git://github.com/graphql/graphql-js.git#npm
Each release of GraphQL.js will be accompanied by an experimental release containing support for the @defer
and @stream
directive proposal. We are hoping to get community feedback on these releases before the proposal is accepted into the GraphQL specification. You can use this experimental release of GraphQL.js by adding the following to your project's package.json
file.
"graphql": "experimental-stream-defer"
Community feedback on this experimental release is much appreciated and can be provided on the issue created for this purpose.
GraphQL.js is a general-purpose library and can be used both in a Node server and in the browser. As an example, the GraphiQL tool is built with GraphQL.js!
Building a project using GraphQL.js with webpack or
rollup should just work and only include
the portions of the library you use. This works because GraphQL.js is distributed
with both CommonJS (require()
) and ESModule (import
) files. Ensure that any
custom build configurations look for .mjs
files!
We actively welcome pull requests. Learn how to contribute.
This repository is managed by EasyCLA. Project participants must sign the free (GraphQL Specification Membership agreement before making a contribution. You only need to do this one time, and it can be signed by individual contributors or their employers.
To initiate the signature process please open a PR against this repo. The EasyCLA bot will block the merge if we still need a membership agreement from you.
You can find detailed information here. If you have issues, please email operations@graphql.org.
If your company benefits from GraphQL and you would like to provide essential financial support for the systems and people that power our community, please also consider membership in the GraphQL Foundation.
Changes are tracked as GitHub releases.
GraphQL.js is MIT-licensed.
The latest stable version of the package.
Stable Version
1
5.3/10
Summary
graphql Uncontrolled Resource Consumption vulnerability
Affected Versions
>= 16.3.0, < 16.8.1
Patched Versions
16.8.1
Reason
18 commit(s) and 10 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 15/30 approved changesets -- score normalized to 5
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
Reason
8 existing vulnerabilities detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More