1.0.34 ā€¢ Published 1 year ago

@appsignal/apollo-server v1.0.34

Weekly downloads
170
License
MIT
Repository
github
Last release
1 year ago

@appsignal/apollo-server

npm (scoped) npm peer dependency version (scoped)

The AppSignal for Node.js integration for Apollo GraphQL (apollo-server) v2.0.0+.

āš ļø This package is no longer required for AppSignal for Node.js version 3.0. If you use version 3.0 or newer in your app, please remove this package from your package.json file.

Installation

First, sign up for an AppSignal account and add both the @appsignal/nodejs and @appsignal/apollo-server packages to your package.json. Then, run yarn install/npm install.

You can also add these packages to your package.json on the command line:

yarn add @appsignal/nodejs @appsignal/apollo-server
npm install --save @appsignal/nodejs @appsignal/apollo-server

You can then import and use the package in your app.

Usage

The module includes an Apollo Server plugin for automatically instrumenting the resolvers of your application.

// ENSURE APPSIGNAL IS THE FIRST THING TO BE REQUIRED/IMPORTED
// INTO YOUR APP!
const { Appsignal } = require("@appsignal/nodejs")
const { createApolloPlugin } = require("@appsignal/apollo-server")

// You can also use one of the apollo-server integrations here,
// e.g. `apollo-server-<integration>`. Note that you will also need to require
// the AppSignal integration seperately.
const { ApolloServer } = require("apollo-server")

const appsignal = new Appsignal({
  active: true,
  name: "<YOUR APPLICATION NAME>",
  pushApiKey: "<YOUR API KEY>"
})

// The GraphQL schema
const typeDefs = gql`
  type Query {
    "A simple type for getting started!"
    hello: String
  }
`

// A map of functions which return data for the schema.
const resolvers = {
  Query: {
    hello: () => 'world',
  },
}

const server = new ApolloServer({
  typeDefs,
  resolvers,
  plugins: [createApolloPlugin(appsignal)]
})

server.listen().then(({ url }) => {
  console.log(`šŸš€ Server ready at ${url}`);
})

NOTE: You must define an operation name for your query to get an action name in the Performance view of AppSignal.com. For example, query FetchData {} would get the action name FetchData on AppSignal.com. If no operation name is set, the query will be grouped under the action name [unknown graphql query].

Contributing

Thinking of contributing to this repo? Awesome! šŸš€

Please follow our Contributing guide in our documentation and follow our Code of Conduct.

Also, we would be very happy to send you Stroopwafles. Have look at everyone we send a package to so far on our Stroopwafles page.

Support

Contact us and speak directly with the engineers working on AppSignal. They will help you get set up, tweak your code and make sure you get the most out of using AppSignal.

1.0.33

1 year ago

1.0.34

1 year ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.26

2 years ago

1.0.27

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.10-beta.0

3 years ago

1.0.9-beta.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-beta.0

4 years ago

0.8.2

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago