node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »

graphql-schema-flickr

graphql-schema-flickr

A GraphQL schema which wraps and tidies up the Flickr REST API.

Install

Npm install:

npm install graphql-schema-flickr

Yarn install:

yarn add graphql-schema-flickr

Getting started

Setup flickr api in graphql context

express with apollo-server-express

import { graphqlExpress } from 'apollo-server-express';
import { Router } from 'express';
import { FlickrSchema, resolvers, typeDefs} from 'graphql-schema-flickr';
import { makeExecutableSchema } from 'graphql-tools';
 
const router = new Router();
 
const flickr = new FlickrSchema({
  key: 'flickrapikeyxxxxxxxxxxxxxxxxxxxx',
});
 
const schema = makeExecutableSchema({
  resolvers,
  typeDefs,
});
 
router.use('/', graphqlExpress({
  context: {
    flickr,
  },
  schema,
}));
 
export { router as default };