0.0.2 • Published 6 years ago

gatsby-source-thingiverse v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

gatsby-source-thingiverse

This source plugin for Gatsby will make collection things from Thingiverse available in GraphQL queries.

Installation

# Install the plugin
yarn add gatsby-source-thingiverse

In gatsby-config.js:

module.exports = {
  plugins: [
    {
      resolve: "gatsby-source-thingiverse",
      options: {
        apiKey: "YOUR_API_KEY_HERE",
        collectionId: "YOUR_COLLECTION_ID_HERE",
      }
    }
  ]
};

Configuration Options

OptionDefaultDescription
apiKeyrequired Your Thingiverse API key
collectionIdrequired The collection id that you want to get

Querying thingiverse Images

Once the plugin is configured, two new queries are available in GraphQL: allThingiverseThing and thingiverseThing.

Here’s an example query to load all the things of the collection:

query ThingQuery {
  {
    allThingiverseThing {
      edges {
        node {
          id
          name
          thumbnail
          url
          public_url
          creator {
            id
            name
          }
          is_private
          is_purchased
          is_published
        }
      }
    }
  }
}

See the Thingiverse API docs or the GraphiQL UI for info on all returned fields.