Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphqlhub-schemas

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphqlhub-schemas - npm Package Compare versions

Comparing version 0.1.0-rc6 to 0.1.0-rc7

20

lib/apis/twitter.js

@@ -24,8 +24,16 @@ 'use strict';

// Twit throws a runtime error if you try to create a client
// without API keys, so we do it lazily
var Twitter = new _twit2.default({
consumer_key: TWITTER_CONSUMER_KEY,
consumer_secret: TWITTER_CONSUMER_SECRET,
app_only_auth: true
});
var twitterClient = undefined;
var getTwitterClient = function getTwitterClient() {
if (!twitterClient) {
twitterClient = new _twit2.default({
consumer_key: TWITTER_CONSUMER_KEY,
consumer_secret: TWITTER_CONSUMER_SECRET,
app_only_auth: true
});
}
return twitterClient;
};

@@ -54,3 +62,3 @@ var getUser = exports.getUser = function getUser(identifier, identity) {

Twitter.get(endpoint, parameters, function (error, result) {
getTwitterClient().get(endpoint, parameters, function (error, result) {

@@ -57,0 +65,0 @@ if (error) {

{
"name": "graphqlhub-schemas",
"repository": "clayallsopp/graphqlhub",
"version": "0.1.0-rc6",
"version": "0.1.0-rc7",
"description": "GraphQL Schemas for REST APIs like Github, Hacker News, Reddit, and Twitter",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

@@ -7,10 +7,12 @@ # graphqlhub-schemas

import { Reddit } from 'graphqlhub-schemas';
import { GraphQLSchema } from 'graphql';
import graphqlHTTP from 'express-graphql';
import { GraphQLSchema, graphql } from 'graphql';
let schema = new GraphQLSchema({
query: Reddit.query
query: Reddit.query.type
});
app.use('/graphql', graphqlHTTP({ schema }));
let query = ' { user(username: "kn0thing") { username } } ';
graphql(schema, query).then((result) => {
console.log(result);
});
```

@@ -26,7 +28,6 @@

let { query } = Schema;
let { type, resolve } = query;
let { type } = query;
// type is a GraphQLObjectType
// resolve is an empty function
```
See [src/index.js](src/index.js) from available schemas.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc