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
<div id="JIRA"></div> | |
<script> | |
document.addEventListener("DOMContentLoaded",function(){window.ATL_JQ_PAGE_PROPS=$.extend(window.ATL_JQ_PAGE_PROPS,{triggerFunction:function(a){setTimeout(function(){a(),$("#atlwdg-blanket").remove(),$("#atlwdg-container").appendTo("#JIRA"),$("#atlwdg-container").css({width:"100%",position:"relative"})},50)}}),jQuery.ajax({url:"https://newspring.atlassian.net/s/d41d8cd98f00b204e9800998ecf8427e-T/-inl9m0/b/c/3d70dff4c40bd20e976d5936642e2171/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs.js?locale=en-US&collectorId=7c75f72b",type:"get",cache:!0,dataType:"script"})}); | |
</script> |
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 bodyParser from "body-parser"; | |
import { graphqlExpress } from "graphql-server-express"; | |
const PORT = 3000; | |
import schema from "./schema"; | |
express() | |
.use( | |
"/graphql", |
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 } from "graphql"; | |
import { Schema, Type, Field, IntType, StringField } from "../schema"; | |
it("creates an executable schema", async () => { | |
// build field resolvers | |
// these will implement Functor and Semigroup (and maybe more) | |
const code = Field(IntType, ({ code }) => code); | |
const message = StringField(({ message }) => message); | |
// create a type from defined fields |
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 type { | |
DocumentNode, | |
ExecutionResult, | |
GraphQLError, | |
SelectionSetNode, | |
FieldNode, | |
InlineFragmentNode, | |
ValueNode, | |
SelectionNode, | |
NameNode, |
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
[libs] | |
./node_modules/react-apollo/lib/index.js.flow | |
./node_modules/apollo-client/lib/index.js.flow |
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
[libs] | |
./node_modules/react-apollo/lib/index.js.flow | |
./node_modules/apollo-client/lib/index.js.flow |
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 React from "react"; | |
import gql from "graphql-tag"; | |
import { graphql } from "react-apollo"; | |
export const HERO_QUERY = gql` | |
query GetCharacter($episode: Episode!) { | |
hero(episode: $episode) { | |
name | |
id | |
friends { |
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
+ // @flow | |
import React from "react"; | |
import gql from "graphql-tag"; | |
import { graphql } from "react-apollo"; | |
+ import type { OperationComponent } from "react-apollo"; | |
export const HERO_QUERY = gql` | |
query GetCharacter($episode: Episode!) { | |
hero(episode: $episode) { |
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 default withCharacter(({ loading, hero, error }) => { | |
// $ExpectError [number] this type cannot be compared to boolean | |
if (loading > 1) return <div>Loading</div>; | |
if (error) return <h1>error.name</h1>; | |
return ...; | |
} |
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 type InputProps = { | |
+ episode: string, | |
+ }; | |
+ export const withCharacter: OperationComponent<Response, InputProps> = graphql(HERO_QUERY, { | |
- export const withCharacter: OperationComponent<Response> = graphql(HERO_QUERY, { | |
+ options: ({ episode }) => ({ | |
+ variables: { episode }, | |
- options: () => ({ |