Coder Social home page Coder Social logo

gridsome-source-graphql-prismic's Introduction

Forked to be used with prismic

original: https://gridsome.org/plugins/@gridsome/source-graphql

@gridsome/source-graphql

Pull a remote GraphQL schema in locally

Install

  • yarn add gridsome-source-graphql-prismic
  • npm install gridsome-source-graphql-prismic

Usage

module.exports = {
  plugins: [
    {
      use: "gridsome-source-graphql-prismic",
      options: {
        url: "https://your-repository.prismic.io",
        fieldName: 'prismicio',
        typeName: 'prismicio',

        headers: { 
          'Prismic-Ref': ``, // useMasterRef will overload this line
          'Authorization': `Token `,
        }

        useMasterRef: true // undefined by default
      }
    }
  ]
};

Options

url

  • Type: string required

The URL of a GraphQL API endpoint to request your schema from.

fieldName

  • Type: string required

The name that should be used to namespace your remote schema when it's merged in, so that it doesn't conflict with any local data.

For instance, if you put "prismicio" your remote schema's data will be available by querying like so:

query {
  prismicio {
    helloWorld
  }
}

typeName

  • Type: string
  • Defaults: fieldName

The prefix to be used for your imported schema's field types.

headers

  • Type: object

An object of headers to be passed along with your request to the API endpoint. This will generally be used to authenticate your request.

useMasterRef

  • Type: boolean

This boolean allows you to automaticaly use the Prismic master REF

Note: For safety, you should pass any sensitive tokens/passwords as environmental variables. To learn more, see the Gridsome Docs on Environmental Variables.

gridsome-source-graphql-prismic's People

Contributors

alariclg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.