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
| 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 () { |
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
| 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 { |
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 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); | |
| } |
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 {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); |
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
| Employee Table Department | |
| id, name id, name, employee_id | |
| 1, Dean Clarke 1, Accounts, 1 | |
| 2, Harshid 2, Legal, 2 | |
| 3, Puja |
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
| Table Students Table Class | |
| id, name, class_id id, name | |
| 1, Dean, 1 1, Math | |
| 3, Shahib, 2 2, English | |
| 4, Chris, null 3, Science |
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
| Table Students | |
| id, name | |
| 1, Dean | |
| 2, Dean | |
| 3, Shahib |
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
| table student table department | |
| id, name, age id, name, student_id | |
| 1, dean, 10 1, Arts, 1 | |
| 2, tah , 10 | |
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
| id, name, age | |
| 1, dean, 10 | |
| 2, dean, 10 | |
| 1, blah, 9 |
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
| await connectionManager.connect(); | |
| let client = await connectionManager.getClient().findOne({'client' : 'local'}); | |
| let grant = await connectionManager.getGrant().findOne({'name' : 'Client_Credential'}); | |
| let service = await connectionManager.getService().findOne({'description' : 'Service 1'}); | |
| let ScopeModel = connectionManager.getScope(); | |
| let scope = new ScopeModel({client_id : client._id, grant_id : grant._id, service_id : service._id}); | |
| await scope.save(); | |
| console.log(await connectionManager.getClient().findOne({'client' : 'local'}).populate('scopes')); |
NewerOlder