@xircus-web3/graph

1.0.121 • Public • Published

@xircus-web3/graph

Documentation

For full documentation and examples, visit Xircus Developer Documentation.

Recent Changes

  • Added support for Array Type Mixed
  • Added Data Source for Skin Routers
  • Added Pagination Params

Installation

Install Xircus Graph SDK and its ethers peer dependency.

npm install @xircus-web3/graph graphql graphql-yoga mongoose

or

yarn add @xircus-web3/graph graphql graphql-yoga mongoose

Usage

  • Sample setup with Mongoose, GraphQL Yoga on NextJS
  • Create pages/api/graphql.js in your next app
  • Make sure to have .env file DATABASE_URL=mongodburl
  • to test locally .env DATABASE_URL=mongodb://localhost:27017/DATABASE_NAME
import { createYoga, createSchema } from 'graphql-yoga'
import mongoose from 'mongoose'
import { 
  providerSchema,
  createProviderSchema,
  createMongo,
  createMongoAuth
} from '@xircus-web3/graph'

const schema = 

const server = createYoga({
  schema: createSchema(schema),
  context: async({ req }) => {
    const models = await createMongo(mongoose, providerSchema)
    const auth = createMongoAuth(req, models)
    return {
      models,
      auth
    }
  }
})

export default server

Community

Check out the following places for more xircus-related content:

Support

If you find @xircus-web3/graph useful, please consider supporting our development. Thank you 🙏

Readme

Keywords

none

Package Sidebar

Install

npm i @xircus-web3/graph

Weekly Downloads

5

Version

1.0.121

License

MIT

Unpacked Size

876 kB

Total Files

4

Last publish

Collaborators

  • xircusteam