-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
latest state, layout mostly done, graphql added, time to stitch up
- Loading branch information
1 parent
e36a121
commit e8beba0
Showing
19 changed files
with
760 additions
and
106 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { LitElement, property, html, css } from "lit-element"; | ||
import { apolloClient } from '../utils/apollo_client'; | ||
import { ApolloQuery } from '@apollo-elements/lit-apollo'; | ||
import gql from 'graphql-tag'; | ||
|
||
|
||
// Compute graphql documents statically for performance | ||
const query = gql` | ||
query($humanId: String) { | ||
getAuthor(humanId: $humanId) { | ||
_id | ||
humanId | ||
firstName | ||
lastName | ||
} | ||
} | ||
`; | ||
|
||
// export class GraphQLTest extends LitElement { | ||
export class GraphQLTest extends ApolloQuery { | ||
@property({ type: Object }) person = {}; | ||
|
||
constructor() { | ||
super(); | ||
this.client = apolloClient; | ||
this.query = query; | ||
console.log('bla'); | ||
|
||
this.variables = { | ||
humanId: "tony-robbins" | ||
} | ||
} | ||
|
||
render() { | ||
const { data, error, loading } = this; | ||
const { helloWorld = {} } = data || {} | ||
return ( | ||
loading ? html` | ||
<what-spin></what-spin>` | ||
: error ? html` | ||
<h1>😢 Such Sad, Very Error! 😰</h1> | ||
<div>${error ? error.message : 'Unknown Error'}</div>` | ||
: html` | ||
<div>it loaded</div> | ||
` | ||
); | ||
|
||
} | ||
} | ||
|
||
customElements.define("graphql-test", GraphQLTest); |
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
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
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
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
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
Oops, something went wrong.