This file contains hidden or 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
{ | |
"name": "my-app", | |
"scripts": { | |
"graphql:write": "graphql-inspector introspect src/schema.js --write schema.graphql" | |
}, | |
"graphql-inspector": { | |
"diff": true, | |
"schema": { | |
"ref": "head/master", | |
"path": "schema.graphql" |
This file contains hidden or 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
function skipIntro() { | |
const el = document.querySelector('.skip-credits'); | |
if(el) { | |
el.children[0].click(); | |
setTimeout(() => { | |
const play = document.querySelector('.button-nfplayerPlay'); | |
if (play) { | |
play.click(); | |
} | |
}, 500); |
This file contains hidden or 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 { GetPostGQL, Post } from './generated/graphql'; | |
@Component({...}) | |
export class PostComponent { | |
@Input() postId: string; | |
post: Observable<Post>; | |
constructor( | |
private getPostGQL: GetPostGQL | |
) {} |
This file contains hidden or 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
query getPost ($id: String!) { | |
post(id: $id) { | |
id | |
text | |
} | |
} |
This file contains hidden or 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 { Apollo } from 'apollo-angular'; | |
import gql from 'graphql-tag'; | |
interface Post { | |
id: string; | |
text: string; | |
} | |
interface PostQuery { | |
post: Post; |
This file contains hidden or 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 { PostResolvers } from './generated-types'; | |
const Post: PostResolvers.Resolvers = { | |
id: (parent) => parent._id, | |
text: (parent) => parent.content | |
}; |
This file contains hidden or 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 PostType = gql` | |
type Post { | |
id: String | |
text: String | |
} | |
`; | |
const Post = { | |
id: (parent) => parent._id, | |
text: (parent) => parent.content |
This file contains hidden or 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
new GraphQLObjectType({ | |
name: 'Post', | |
fields: { | |
id: { | |
type: GraphQLString, | |
resolve: (parent) => parent._id | |
}, | |
text: { | |
type: GraphQLString, | |
resolve: (parent) => parent.content |
This file contains hidden or 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
type Post { | |
id: String | |
text: String | |
} |
This file contains hidden or 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
new GraphQLObjectType({ | |
name: 'Post', | |
fields: { | |
id: { | |
type: GraphQLString | |
}, | |
text: { | |
type: GraphQLString | |
} | |
} |