Skip to content

Instantly share code, notes, and snippets.

@shri-kanth
shri-kanth / script.sh
Created February 7, 2018 06:34 — forked from rohithpeddi/script.sh
Post install script
#!/bin/bash
#Steps to run this script
# $ sudo -s
# $ touch script.sh
## copy paste this file to script.sh
# $ chmod +x script.sh
# $ ./script.sh 2>&1 | tee scriptoutput
@shri-kanth
shri-kanth / getListsResponse.json
Created April 23, 2019 11:50
Example REST response for list collection Resource
{
"link": {
"rel": "self",
"href": "/lists"
},
"lists": [
{
"link": {
"rel": "self",
"href": "/lists/41"
@shri-kanth
shri-kanth / getListResponse.json
Created April 23, 2019 11:54
Example Rest Response for Get List Request
{
"list": {
"link": {
"rel": "self",
"href": "/lists/42"
},
"id": 42,
"position": 1,
"name": "Doing",
"listItems": {
query {
lists(positions: 1) {
items(positions: [0]) {
name
}
}
}
{
"item": {
"link": {
"rel": "self",
"href": "/items/24"
},
"id": 24,
"position": 0,
"listId": 42,
"name": "Write"
{
"data": {
"lists": [
{
"items": [
{
"name": "Write"
}
]
}
schema {
query: Query
mutation: Mutation
}
type List {
id:ID!
name:String
position:Int
# if 'positions' is included items in only those positions are considered,
public class GraphQLProvider {
// Initializes the GraphQL configuration and Handles Requests from the clients
private static final String GRAPHQL_SCHEMA_FILE = "/schema.graphqls";
private GraphQL graphQL;
@Autowired
private GraphQLDataFetcher graphQLDataFetcher;
public class GraphQLDataFetcher {
// Communicates with Application's Service Layer and Fetches data required by GraphQL
@Autowired
private ListEntityService listEntityService;
@Autowired
private ItemService itemService;
import {NgModule} from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
// Apollo
import { ApolloModule, Apollo } from 'apollo-angular';
import { HttpLinkModule, HttpLink } from 'apollo-angular-link-http';
import {InMemoryCache} from 'apollo-cache-inmemory';
const uri = 'http://localhost:8080/graphql'; // Back-End GraphQL EndPoint