Skip to content

Instantly share code, notes, and snippets.

View dclarke-modus's full-sized avatar

dclarke-modus

View GitHub Profile
Employee Table Department
id, name id, name, employee_id
1, Dean Clarke 1, Accounts, 1
2, Harshid 2, Legal, 2
3, Puja
import {GraphQLSchema, GraphQLObjectType, GraphQLInt, GraphQLString, GraphQLList, GraphQLBoolean} from 'graphql';
import {connectionArgs, connectionDefinitions, connectionFromArray, connectionFromPromisedArray, fromGlobalId, globalIdField, mutationWithClientMutationId, nodeDefinitions} from 'graphql-relay';
import {ClientModel, ScopeModel, TokenModel, GrantModel} from '../schemas';
let Schema = () => {
let {nodeInterface, nodeField} = nodeDefinitions(
(globalId) => {
var {type, id} = fromGlobalId(globalId);
import React from 'react';
import {createFragmentContainer, graphql} from 'react-relay';
import scopeAction from './actions/scopeModalAction';
class Scope extends React.Component {
constructor(props, context) {
super(props, context);
this.editScope = this.editScope.bind(this);
}
let Schema = () => {
let {nodeInterface, nodeField} = nodeDefinitions(
(globalId) => {
var {type, id} = fromGlobalId(globalId);
if (type === 'Grant') {
return GrantModel.findById(id);
} else if (type === 'Scope') {
return ScopeModel.findById(id);
} else {
class ScopeModal extends React.Component {
constructor(props) {
super(props);
this._onChange = this._onChange.bind(this);
this.handleClose = this.handleClose.bind(this);
this.state = { show: false, scope: null, form: {name : null, description: null, enabled : null, id: null, grants : []} };
}
componentWillMount () {