This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import seaborn as sns | |
df_2012_2013 = pd.read_csv('./data/2012-2013.csv'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { graphql, compose } from 'react-apollo'; | |
function UserProfile(props) { | |
return 'Your Name is: {props.data.currentUser.name}'; | |
} | |
export default compose(graphql(query))(UserProfile); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const query = gql` | |
query MyExampleQuery { | |
currentUser { | |
name | |
photo | |
friends(limit: 10) { | |
name | |
photo | |
friends(limit: 10) { | |
name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
scrape(url: 'https://google.com') { | |
div(id: 'header') { | |
ul { | |
li { | |
a { | |
href | |
content | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
scrape(url: 'https://google.com') { | |
links { | |
title | |
footer { | |
content | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const query = gql` | |
query MyExampleQuery { | |
currentUser { | |
name | |
photo | |
} | |
} | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express'; | |
import cors from 'cors'; | |
import graphqlHTTP from 'express-graphql'; | |
import schema from './schema'; | |
const app = express(); | |
app.use(cors()); | |
app.use('/', (req, res) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
graphql, | |
GraphQLSchema, | |
GraphQLObjectType, | |
GraphQLString | |
} from 'graphql'; | |
import { HtmlPage } from './resolvers'; | |
var schema = new GraphQLSchema({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cheerio from 'cheerio'; | |
import fetch from 'node-fetch'; | |
import { | |
graphql, | |
GraphQLSchema, | |
GraphQLObjectType, | |
GraphQLString, | |
GraphQLInt, | |
GraphQLList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const HtmlPage = new GraphQLObjectType({ | |
name: 'HtmlPage', | |
fields: () => ({ | |
url: { | |
type: GraphQLString, | |
resolve(root, args, context) { | |
return root.url; | |
} | |
}, | |
hostname: { |
OlderNewer