@ssb-graphql/artefact

    4.2.0 • Public • Published

    @ssb-graphql/artefact

    GraphQL types and resolvers for the ssb-artefact plugin.

    Usage

    Install ssb-graphql's main and artefact packages:

    npm i -S @ssb-graphql/main @ssb-graphql/artefact

    Example Usage

    const { ApolloServer } = require('apollo-server-express')
    const { buildFederatedSchema } = require('@apollo/federation');
    
    const Server = require('ssb-server')
    const Config = require('ssb-config/inject')
    
    const config = Config({})
    
    const sbot = Server
      .use(require('ssb-backlinks'))
      .use(require('ssb-artefact'))
      .call(null, config)
    
    const main = require('@ssb-graphql/main')(sbot)
    const artefact = require('@ssb-graphql/artefact')(sbot)
    
    profile.Context(sbot, (err, context) => {
      if (err) throw err
      const server = new ApolloServer({
        schema: buildFederatedSchema([
          { typeDefs: main.typeDefs, resolvers: main.resolvers },
          { typeDefs: artefact.typeDefs, resolvers: artefact.resolvers },
        ]),
        context
      })
    })

    Install

    npm i @ssb-graphql/artefact

    DownloadsWeekly Downloads

    13

    Version

    4.2.0

    License

    AGPL-3.0

    Unpacked Size

    16.7 kB

    Total Files

    12

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar