Skip to content

Instantly share code, notes, and snippets.

@afreeland
Created May 1, 2018 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afreeland/230c3851839d9593f7ed6a929b4540f1 to your computer and use it in GitHub Desktop.
Save afreeland/230c3851839d9593f7ed6a929b4540f1 to your computer and use it in GitHub Desktop.
React: Proper declaring enum type
import React, { Component } from 'react';
import { render } from 'react-dom';
const gql = require('graphql-tag');
import { graphql } from 'react-apollo';
import appRoot from 'app-root-path';
import store from '../../store.js';
const Recent_Query = gql(`
query recent_query($username: String! $type: recentTypess! ){
recent (username: $username type: $type){
uid
}
}
`);
class AnalyticHistory extends Component {
constructor(props){
super(props)
}
render(){
return <div>...</div>
}
}
const History_HOC = graphql(Recent_Query, {
options: ({username, type}) => ({ variables: {username, type}})
})(AnalyticHistory)
export default History_HOC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment