Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 12, 2024 via pnpm

graphql 15.8.0

A Query Language and Runtime which can target any service.
Package summary
Share
0
issues
1
license
1
MIT
Package created
4 Feb 2015
Version published
7 Dec 2021
Maintainers
8
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
graphql@15.8.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of graphql 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does graphql do?

GraphQL is a query language and runtime for APIs, offering a more efficient alternative to REST. It was originally designed by Facebook and is now maintained as an open-source project. It allows you to ask for specific data, letting the server know exactly what you need, which can lead to fewer bytes over the network and faster loading times. GraphQL can target any service, providing you with an incredible amount of flexibility when it comes to fetching and interacting with data.

How do you use graphql?

To begin using GraphQL, first, you will need to add the package to your JavaScript project. You can do this using npm or yarn:

With npm:

npm install --save graphql

or using Yarn:

yarn add graphql

Once installed, you can then import GraphQL into your file and define a schema using the provided classes. This schema can then map to your codebase:

import {
  graphql,
  GraphQLSchema,
  GraphQLObjectType,
  GraphQLString,
} from 'graphql';

var schema = new GraphQLSchema({
  query: new GraphQLObjectType({
    name: 'RootQueryType',
    fields: {
      hello: {
        type: GraphQLString,
        resolve() {
          return 'world';
        },
      },
    },
  }),
});

With your schema defined, you can then serve the result of a query against that schema:

var source = '{ hello }';

graphql({ schema, source }).then((result) => {
  console.log(result);
});

This will return a Promise that resolves to an object, which will contain the data requested if the query is valid. In case of an invalid query, it will print the corresponding error(s).

If you want to use the latest not-yet-released version of graphql-js, you can do so by depending directly on the npm branch of the repository:

npm install graphql@git://github.com/graphql/graphql-js.git#npm

Where are the graphql docs?

The comprehensive documentation for GraphQL, including its JavaScript implementation, can be found at https://graphql.org/ and https://graphql.org/graphql-js/. The documentation provides a detailed analysis of GraphQL as well as a multitude of examples, helping developers understand and utilize the power of GraphQL effectively.