sg

stripe-graphql

[WIP] 🚧🚧🚧 😎 Community-driven Stripe GraphQL API with superpowers.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

49

Maintenance

Last Commit

1yr ago

Contributors

1

Package

Dependencies

5

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Node.js GraphQL

Readme

Preview

stripe-graphql

npm license

⚠️ Warning! This is a very early version. You SHOULD NOT use this in production yet.

What is stripe-graphql?

stripe-graphql is a GraphQL API for Stripe with a lot of benefits. Its goal is to help you do things better and faster related to the Stripe world while providing you with the best developer experience (DX).

It ships with a type-safe GraphQL client, and exposes the GraphQL schema object so that you can create your own Stripe GraphQL API, transform the schema or do whatever you need.

Features

  • ✅ Simple and powerful
  • ✅ Formatted amounts ready to use
  • ✅ Type-safe GraphQL-based client
  • ✅ Expose the GraphQL schema object

TODO

  • DataLoader support for batching and caching
  • Nexus extension/plugin for more easy integration

Get started

npm install stripe-graphql or yarn add stripe-graphql.

Client

Request

import { client } from "stripe-graphql";

try {
  const data = await client.query({
    plans: {
      nickname: true,
      active: true,
      amount: { raw: true, raw_formatted: true, formatted: true },
      currency: { code: true, symbol: true },
    },
  });
  console.log(JSON.stringify(data, null, 2));
} catch (error) {
  console.log(error);
}

Response

{
  "plans": [
    {
      "nickname": "premium-monthly-plan-in-eur",
      "active": true,
      "amount": {
        "raw": 1499,
        "raw_formatted": 14.99,
        "formatted": "€14.99"
      },
      "currency": {
        "code": "EUR",
        "symbol": "€"
      }
    },
    {
      "nickname": "standard-monthly-plan-in-eur",
      "active": true,
      "amount": {
        "raw": 999,
        "raw_formatted": 9.99,
        "formatted": "€9.99"
      },
      "currency": {
        "code": "EUR",
        "symbol": "€"
      }
    },
    {
      "nickname": "basis-monthly-plan-in-eur",
      "active": true,
      "amount": {
        "raw": 499,
        "raw_formatted": 4.99,
        "formatted": "€4.99"
      },
      "currency": {
        "code": "EUR",
        "symbol": "€"
      }
    }
  ]
}

Schema

import { schema } from "stripe-graphql";

// Do whatever you need with the schema

Contributing

Do you know how to improve it? Feel free to contribute to this project.

  1. Install dependencies: npm install or yarn install
  2. Run the development server: npm run dev or yarn dev

The server should start. You're ready to help. 🙏

License

MIT.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

apollo-boost:rocket:  A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server.
User Rating
4.6/ 5
5
Top Feedback
4Great Documentation
4Easy to Use
3Performant
GitHub Stars
17K
Weekly Downloads
247K
graphql-tagA JavaScript template literal tag that parses GraphQL queries
User Rating
3.8/ 5
4
Top Feedback
3Great Documentation
3Easy to Use
2Performant
GitHub Stars
2K
Weekly Downloads
4M
eg
elasticsearch-graphqlSchema generator and query builder for elasticsearch
User RatingN/A
Top Feedback
N/A
GitHub Stars
166
Weekly Downloads
2
postgraphileExecute one command (or mount one Node.js middleware) and get an instant high-performance GraphQL API for your PostgreSQL database!
User Rating
4.8/ 5
6
Top Feedback
3Highly Customizable
2Easy to Use
2Performant
GitHub Stars
11K
Weekly Downloads
4K
auc
apollo-upload-clientA terminating Apollo Link for Apollo Client that fetches a GraphQL multipart request if the GraphQL variables contain files (by default FileList, File, Blob, or ReactNativeFile instances), or else fetches a regular GraphQL POST or GET request (depending on the config and GraphQL operation).
User Rating
4.8/ 5
4
Top Feedback
3Easy to Use
1Great Documentation
1Bleeding Edge
GitHub Stars
1K
Weekly Downloads
780K
See 21 Alternatives

Tutorials

No tutorials found
Add a tutorial