| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403 |
- // 注意是否使用 gql
- // apollo client 需要使用 gql
- // graphql-request 不需要使用 gql
- // import gql from "graphql-tag";
- const GET_USER = `
- query USER($id: ID!) {
- user_by_id(id: $id) {
- nickname
- avatar
- }
- }
- `;
- const SEARCH_USER = `
- query USER($username: String) {
- user_by_props(username: $username) {
- username
- }
- }
- `;
- const ADD_USER = `
- mutation USER($email: String, $updatedAt: String, $password: String, $telephone: String, $nickname: String, $username: String, $createdAt: String, $openid: String, $id: ID!, $avatar: String) {
- create_user(
- email: $email
- updatedAt: $updatedAt
- password: $password
- telephone: $telephone
- nickname: $nickname
- username: $username
- createdAt: $createdAt
- openid: $openid
- id: $id
- avatar: $avatar
- ) {
- email
- updatedAt
- password
- telephone
- nickname
- username
- createdAt
- openid
- id
- avatar
- }
- }
- `;
- const SHOW_SCHEMA = `
- query SCHEMA($user_id: ID) {
- schema_by_props(user_id: $user_id) {
- schemaData
- schemaName
- id
- reference
- }
- }
- `;
- const SHOW_ALL_SCHEMA = `
- query SCHEMA($user_id: ID) {
- userSchema:schema_by_props(user_id: $user_id) {
- schemaData
- schemaName
- id
- reference
- }
- caseSchema:schema_by_props(user_id: "ioobot") {
- schemaData
- schemaName
- id
- reference
- }
- }
- `;
- const SEARCH_SCHEMA = `
- query SCHEMA($id: ID!) {
- schema_by_id(id: $id) {
- schemaName
- schemaData
- id
- reference
- }
- }
- `;
- const ADD_SCHEMA = `
- mutation SCHEMA($id: ID!, $user_id: ID!, $schemaName: String!, $schemaData: String!, $createdAt: String, $updatedAt: String, $schemaState: String, $reference: String) {
- create_schema(
- id: $id,
- user_id: $user_id,
- schemaName: $schemaName,
- createdAt: $createdAt,
- updatedAt: $updatedAt,
- schemaData: $schemaData,
- schemaState: $schemaState
- reference: $reference
- ) {
- schemaName,
- schemaData
- id
- reference
- }
- }
- `;
- const DELETE_SCHEMA = `
- mutation SCHEMA($schemaName: String, $user_id: ID) {
- delete_schema(schemaName: $schemaName, user_id: $user_id)
- }
- `;
- const UPDATE_SCHEMA = `
- mutation SCHEMA($id: ID!, $schemaData: String!, $updatedAt: String, $schemaState: String) {
- update_schema(
- id: $id,
- updatedAt: $updatedAt,
- schemaData: $schemaData,
- schemaState: $schemaState
- ) {
- schemaName,
- schemaData
- id
- }
- }
- `;
- const UPDATE_SCHEMA_NAME = `
- mutation SCHEMA($id: ID!, $schemaName: String, $updatedAt: String) {
- update_schema(
- id: $id,
- updatedAt: $updatedAt,
- schemaName: $schemaName,
- ) {
- schemaName,
- id
- }
- }
- `;
- const SHOW_TABLE = `
- query TABLE($schema_id: ID!) {
- schema_by_id(id: $schema_id) {
- schemaData
- schemaName
- }
- }
- `;
- const ADD_CLOUD = `
- mutation CLOUD($id: ID!, $user_id: ID, $cloudName: String, $secretId: String, $secretKey: String, $updatedAt: String, $createdAt: String, $appId: String) {
- create_cloud(
- id: $id
- user_id: $user_id
- cloudName: $cloudName
- secretId: $secretId
- secretKey: $secretKey
- createdAt: $createdAt
- updatedAt: $updatedAt
- appId: $appId
- ) {
- id
- }
- }
- `;
- const SHOW_CLOUD = `
- query CLOUD($user_id: ID!) {
- cloud_by_props(user_id: $user_id) {
- id
- cloudName
- secretId
- secretKey
- }
- }
- `;
- const UPDATE_CLOUD = `
- mutation updatecloud($id: ID, $secretId: String, $secretKey: String $updatedAt: String) {
- update_cloud(
- id: $id
- secretId: $secretId
- secretKey: $secretKey
- updatedAt: $updatedAt
- ) {
- id
- }
- }
- `;
- const SHOW_DEPLOY = `
- query DEPLOY($cloud_id: ID!) {
- deploy_by_props(cloud_id: $cloud_id) {
- id
- functionName
- region
- description
- cosBucketName
- cosObjectName
- cosBucketRegion
- handler
- memorySize
- timeout
- vpcId
- subnetId
- }
- }
- `;
- const ADD_DEPLOY = `
- mutation DEPLOY($serviceName:String, $description: String, $updatedAt: String, $cosBucketName: String, $memorySize: Int, $fc_id: ID, $createdAt: String, $subnetId: String, $cosObjectName: String, $region: String, $vpcId: String, $cosBucketRegion: String, $id: ID!, $cloud_id: ID, $user_id: ID, $timeout: Int, $handler: String, $functionName: String) {
- create_deploy(
- id: $id
- description: $description
- cosBucketName: $cosBucketName
- memorySize: $memorySize
- fc_id: $fc_id
- subnetId: $subnetId
- cosObjectName: $cosObjectName
- region: $region
- vpcId: $vpcId
- cosBucketRegion: $cosBucketRegion
- cloud_id: $cloud_id
- user_id: $user_id
- timeout: $timeout
- handler: $handler
- functionName: $functionName
- serviceName: $serviceName
- createdAt: $createdAt
- updatedAt: $updatedAt
- ) {
- id
- }
- }
- `;
- const UPDATE_DEPLOY = `
- mutation DEPLOY($id: ID!, $description: String, $updatedAt: String, $cosBucketName: String, $subnetId: String, $cosObjectName: String, $region: String, $vpcId: String, $cosBucketRegion: String, $functionName: String) {
- update_deploy(
- id: $id
- description: $description
- cosBucketName: $cosBucketName
- subnetId: $subnetId
- cosObjectName: $cosObjectName
- region: $region
- vpcId: $vpcId
- cosBucketRegion: $cosBucketRegion
- functionName: $functionName
- updatedAt: $updatedAt
- ) {
- id
- }
- }
- `;
- const SHOW_APIGWGROUP = `
- query GROUP($cloud_id: ID!) {
- apiGWGroup_by_props(cloud_id: $cloud_id) {
- id
- groupName
- region
- frontType
- defaultDomain
- userStatus
- userDomain
- }
- }
- `;
- const ADD_APIGROUP = `
- mutation GROUP($serviceId: String, $environmentName: String, $userStatus: String, $defaultDomain: String, $updatedAt: String, $userDomain: String, $groupName: String, $createdAt: String, $frontType: String, $region: String, $status: String, $id: ID!, $cloud_id: ID, $user_id: ID) {
- create_apiGWGroup(
- id: $id
- userStatus: $userStatus
- defaultDomain: $defaultDomain
- updatedAt: $updatedAt
- userDomain: $userDomain
- groupName: $groupName
- createdAt: $createdAt
- frontType: $frontType
- region: $region
- status: $status
- cloud_id: $cloud_id
- user_id: $user_id
- environmentName: $environmentName
- serviceId: $serviceId
- ) {
- id
- }
- }
- `;
- const UPDATE_APIGROUP = `
- mutation GROUP($id:ID!, $environmentName: String, $userStatus: String, $updatedAt: String, $userDomain: String, $groupName: String, $frontType: String, $region: String) {
- update_apiGWGroup(
- id: $id
- userStatus: $userStatus
- userDomain: $userDomain
- groupName: $groupName
- frontType: $frontType
- region: $region
- environmentName: $environmentName
- updatedAt: $updatedAt
- ) {
- id
- }
- }
- `;
- const SHOW_APIGWPATH = `
- query PATH($apiGWGroup_id: ID!) {
- apiGWPath_by_props(apiGWGroup_id: $apiGWGroup_id) {
- id
- apiGWName
- apiGWDesc
- requestMethod
- }
- }
- `;
- const ADD_APIGWPATH = `
- mutation PATH($apiId: String, $apiGWName: String, $updatedAt: String, $apiGWGroup_id: ID, $createdAt: String, $deploy_id: ID, $serviceType: String, $id: ID!, $apiGWPath: String, $user_id: ID, $timeout: Int, $apiGWDesc: String, $requestMethod: String) {
- create_apiGWPath(
- apiGWName: $apiGWName
- updatedAt: $updatedAt
- apiGWGroup_id: $apiGWGroup_id
- createdAt: $createdAt
- deploy_id: $deploy_id
- serviceType: $serviceType
- id: $id
- apiGWPath: $apiGWPath
- user_id: $user_id
- timeout: $timeout
- apiGWDesc: $apiGWDesc
- requestMethod: $requestMethod
- apiId: $apiId
- ) {
- id
- }
- }
- `;
- const UPDATE_APIGWPATH = `
- mutation PATH($apiGWName: String, $updatedAt: String, $apiGWDesc: String, $requestMethod: String) {
- update_apiGWPath(
- apiGWName: $apiGWName
- apiGWDesc: $apiGWDesc
- requestMethod: $requestMethod
- updatedAt: $updatedAt
- ) {
- id
- }
- }
- `;
- const SHOW_FC = `
- query FC($schema_id: ID!) {
- fc_by_props(schema_id: $schema_id) {
- cloud_id {
- id
- cloudName
- }
- }
- }
- `;
- export {
- ADD_USER,
- GET_USER,
- SEARCH_USER,
- SEARCH_SCHEMA,
- ADD_SCHEMA,
- SHOW_ALL_SCHEMA,
- SHOW_SCHEMA,
- UPDATE_SCHEMA,
- UPDATE_SCHEMA_NAME,
- DELETE_SCHEMA,
- SHOW_TABLE,
- ADD_CLOUD,
- SHOW_CLOUD,
- UPDATE_CLOUD,
- SHOW_DEPLOY,
- ADD_DEPLOY,
- UPDATE_DEPLOY,
- SHOW_APIGWGROUP,
- ADD_APIGROUP,
- UPDATE_APIGROUP,
- SHOW_APIGWPATH,
- ADD_APIGWPATH,
- UPDATE_APIGWPATH,
- SHOW_FC
- }
|