Skip to content

Instantly share code, notes, and snippets.

query {
search(text: "cat") {
username
friends {
username
}
}
}
query {
search(text: "cat") {
???
}
}
query ($username: String = "GovSchwarzenegger"){
reddit {
user(username: $username) {
username
commentKarma
createdISO
}
}
}
POST https://www.graphqlhub.com/graphql
{
"query":"query ($username: String!){
reddit {
user(username: $username) {
username
commentKarma
createdISO
}
}
query ($username: String!) {
reddit {
user(username: $username) {
username
commentKarma
createdISO
}
}
}
class App extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Loading remote component...
</Text>
<RemoteComponent url="http://localhost:8000/getComponent.js" />
</View>
);
import React, { View, Text } from 'react-native';
export default class RemoteComponent extends React.Component {
state = {};
componentDidMount() {
fetch(this.props.url).then((response) => {
return response.text();
}).then((js) => {
let factory = eval(js);
export class User {
handle: string;
constructor(handle) {
this.handle = handle;
}
}
"scripts": {
"build": "rm -rf ./dist/ && rm -rf ./tsDist/ && tsc && webpack && open index.html"
}
module.exports = {
entry: "./tsDist/index.js",
// ...
};