gql.js 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  1. // 注意是否使用 gql
  2. // apollo client 需要使用 gql
  3. // graphql-request 不需要使用 gql
  4. // import gql from "graphql-tag";
  5. const GET_USER = `
  6. query USER($id: ID!) {
  7. user_by_id(id: $id) {
  8. email
  9. updatedAt
  10. password
  11. telephone
  12. nickname
  13. username
  14. createdAt
  15. openid
  16. id
  17. avatar
  18. }
  19. }
  20. `;
  21. const SEARCH_USER = `
  22. query USER($username: String) {
  23. user_by_props(username: $username) {
  24. email
  25. updatedAt
  26. password
  27. telephone
  28. nickname
  29. username
  30. createdAt
  31. openid
  32. id
  33. avatar
  34. }
  35. }
  36. `;
  37. const ADD_USER = `
  38. mutation USER($email: String, $language: String, $updatedAt: String, $password: String, $telephone: String, $nickname: String, $username: String, $createdAt: String, $openid: String, $id: ID!, $avatar: String) {
  39. create_user(
  40. language: $language
  41. email: $email
  42. updatedAt: $updatedAt
  43. password: $password
  44. telephone: $telephone
  45. nickname: $nickname
  46. username: $username
  47. createdAt: $createdAt
  48. openid: $openid
  49. id: $id
  50. avatar: $avatar
  51. ) {
  52. language
  53. email
  54. updatedAt
  55. password
  56. telephone
  57. nickname
  58. username
  59. createdAt
  60. openid
  61. id
  62. avatar
  63. }
  64. }
  65. `;
  66. const UPDATE_USER = `
  67. mutation USER($email: String, $language: String, $updatedAt: String, $telephone: String, $nickname: String, $openid: String, $id: ID!, $avatar: String) {
  68. update_user(
  69. id: $id
  70. language: $language
  71. email: $email
  72. updatedAt: $updatedAt
  73. telephone: $telephone
  74. nickname: $nickname
  75. openid: $openid
  76. avatar: $avatar
  77. ) {
  78. language
  79. email
  80. updatedAt
  81. password
  82. telephone
  83. nickname
  84. username
  85. createdAt
  86. openid
  87. id
  88. avatar
  89. }
  90. }
  91. `;
  92. const SHOW_SCHEMA = `
  93. query SCHEMA($user_id: ID) {
  94. schema_by_props(user_id: $user_id) {
  95. schemaData
  96. schemaName
  97. id
  98. reference
  99. schemaState
  100. }
  101. }
  102. `;
  103. const SHOW_CASE_SCHEMA = `
  104. query SHOW_CASE_SCHEMA {
  105. caseSchema:schema_by_props(user_id: "ioobot") {
  106. schemaData
  107. schemaName
  108. id
  109. reference
  110. schemaState
  111. }
  112. }
  113. `;
  114. const SHOW_ALL_SCHEMA = `
  115. query SCHEMA($user_id: ID) {
  116. userSchema:schema_by_props(user_id: $user_id) {
  117. schemaData
  118. schemaName
  119. id
  120. reference
  121. schemaState
  122. }
  123. caseSchema:schema_by_props(user_id: "ioobot") {
  124. schemaData
  125. schemaName
  126. id
  127. reference
  128. schemaState
  129. }
  130. }
  131. `;
  132. const SEARCH_SCHEMA = `
  133. query SCHEMA($id: ID!) {
  134. schema_by_id(id: $id) {
  135. schemaName
  136. schemaData
  137. id
  138. reference
  139. schemaState
  140. }
  141. }
  142. `;
  143. const ADD_SCHEMA = `
  144. mutation SCHEMA($id: ID!, $user_id: ID!, $schemaName: String!, $schemaData: String!, $createdAt: String, $updatedAt: String, $schemaState: String, $reference: String) {
  145. create_schema(
  146. id: $id,
  147. user_id: $user_id,
  148. schemaName: $schemaName,
  149. createdAt: $createdAt,
  150. updatedAt: $updatedAt,
  151. schemaData: $schemaData,
  152. schemaState: $schemaState
  153. reference: $reference
  154. ) {
  155. schemaName,
  156. schemaData
  157. id
  158. reference
  159. schemaState
  160. }
  161. }
  162. `;
  163. const DELETE_SCHEMA = `
  164. mutation SCHEMA($schemaName: String, $user_id: ID) {
  165. delete_schema(schemaName: $schemaName, user_id: $user_id)
  166. }
  167. `;
  168. const UPDATE_SCHEMA = `
  169. mutation SCHEMA($id: ID!, $schemaData: String!, $updatedAt: String, $schemaState: String) {
  170. update_schema(
  171. id: $id,
  172. updatedAt: $updatedAt,
  173. schemaData: $schemaData,
  174. schemaState: $schemaState
  175. ) {
  176. schemaName,
  177. schemaData
  178. id
  179. schemaState
  180. }
  181. }
  182. `;
  183. const UPDATE_SCHEMA_PROJECT_NAME = `
  184. mutation UPDATE_SCHEMA_PROJECT_NAME($schemaID: ID!, $projectID: ID, $schemaName: String, $updatedAt: String) {
  185. update_schema(
  186. id: $schemaID,
  187. updatedAt: $updatedAt,
  188. schemaName: $schemaName,
  189. ) {
  190. schemaName,
  191. id
  192. schemaState
  193. }
  194. update_project(
  195. id: $projectID,
  196. updatedAt: $updatedAt,
  197. projectName: $schemaName,
  198. ){
  199. projectName,
  200. id,
  201. schema_id{
  202. id
  203. }
  204. }
  205. }
  206. `;
  207. const ADD_PROJECT_AND_SCHEMA = `
  208. mutation ADD_PROJECT_AND_SCHEMA($schemaId: ID!, $user_id: ID!, $schemaName: String!, $schemaData: String!, $schemaCreatedAt: String, $schemaUpdatedAt: String, $schemaState: String, $reference: String,
  209. , $projectStatus: String, $projectCreatedAt: String, $projectUpdatedAt: String, $database_id: ID, $case_id: ID, $apiGWGroup_id: ID, $projectName: String, $deploy_id: ID, $projectId: ID!, $projectType: String, $cloud_id: ID, $user_id: ID, $wxConfig_id: ID, $schema_id: ID) {
  210. create_schema(
  211. id: $schemaId,
  212. user_id: $user_id,
  213. schemaName: $schemaName,
  214. createdAt: $schemaCreatedAt,
  215. updatedAt: $schemaUpdatedAt,
  216. schemaData: $schemaData,
  217. schemaState: $schemaState
  218. reference: $reference
  219. ) {
  220. schemaName,
  221. schemaData
  222. id
  223. reference
  224. schemaState
  225. }
  226. create_project(
  227. createdAt: $projectCreatedAt,
  228. updatedAt: $projectUpdatedAt,
  229. database_id: $database_id,
  230. apiGWGroup_id: $apiGWGroup_id,
  231. projectName: $projectName,
  232. deploy_id: $deploy_id,
  233. id: $projectId,
  234. projectType: $projectType,
  235. cloud_id: $cloud_id,
  236. user_id: $user_id,
  237. wxConfig_id: $wxConfig_id,
  238. schema_id: $schema_id
  239. projectStatus: $projectStatus
  240. case_id: $case_id
  241. ) {
  242. projectStatus
  243. updatedAt
  244. createdAt
  245. projectName
  246. id
  247. projectType
  248. schema_id {
  249. updatedAt
  250. schemaState
  251. authWrite
  252. authReadObjects
  253. createdAt
  254. authRead
  255. schemaName
  256. reference
  257. id
  258. schemaData
  259. authReadWrite
  260. authWriteObjects
  261. }
  262. }
  263. }
  264. `;
  265. const ADD_PROJECT = `
  266. mutation createproject($updatedAt: String, $database_id: ID, $apiGWGroup_id: ID, $case_id: ID, $createdAt: String, $projectStatus: String, $projectName: String, $deploy_id: ID, $notification_id: ID, $id: ID!, $projectType: String, $cloud_id: ID, $user_id: ID, $wxConfig_id: ID, $schema_id: ID) {
  267. createproject: create_project(updatedAt: $updatedAt database_id: $database_id case_id: $case_id apiGWGroup_id: $apiGWGroup_id createdAt: $createdAt projectStatus: $projectStatus projectName: $projectName deploy_id: $deploy_id notification_id: $notification_id id: $id projectType: $projectType cloud_id: $cloud_id user_id: $user_id wxConfig_id: $wxConfig_id schema_id: $schema_id) {
  268. projectStatus
  269. updatedAt
  270. createdAt
  271. projectName
  272. id
  273. projectType
  274. }
  275. }
  276. `;
  277. const ADD_PROJECT_AND_WX = `
  278. mutation ADD_PROJECT_AND_WX($wxUpdatedAt: String, $mch_id: String, $appName: String, $notify_url: String, $appSecret: String, $wxCreatedAt: String, $appID: String, $token: String, $spbill_create_ip: String, $enter_url: String, $wxConfigId: ID!, $pay_api_key: String, $user_id: ID, $body: String, $welcome_words: String, $attach: String
  279. , $projectStatus: String, $projectCreatedAt: String, $projectUpdatedAt: String, $database_id: ID, $case_id: ID, $apiGWGroup_id: ID, $projectName: String, $deploy_id: ID, $projectId: ID!, $projectType: String, $cloud_id: ID, $user_id: ID, $wxConfig_id: ID, $schema_id: ID) {
  280. create_wxConfig(
  281. createdAt: $wxCreatedAt
  282. updatedAt: $wxUpdatedAt
  283. mch_id: $mch_id
  284. appName: $appName
  285. notify_url: $notify_url
  286. appSecret: $appSecret
  287. appID: $appID
  288. token: $token
  289. spbill_create_ip: $spbill_create_ip
  290. enter_url: $enter_url
  291. id: $wxConfigId
  292. pay_api_key: $pay_api_key
  293. user_id: $user_id
  294. body: $body
  295. welcome_words: $welcome_words
  296. attach: $attach
  297. ) {
  298. mch_id
  299. appName
  300. notify_url
  301. appSecret
  302. appID
  303. token
  304. spbill_create_ip
  305. enter_url
  306. id
  307. pay_api_key
  308. body
  309. welcome_words
  310. attach
  311. }
  312. create_project(
  313. createdAt: $projectCreatedAt,
  314. updatedAt: $projectUpdatedAt,
  315. database_id: $database_id,
  316. apiGWGroup_id: $apiGWGroup_id,
  317. projectName: $projectName,
  318. deploy_id: $deploy_id,
  319. id: $projectId,
  320. projectType: $projectType,
  321. cloud_id: $cloud_id,
  322. user_id: $user_id,
  323. wxConfig_id: $wxConfig_id,
  324. schema_id: $schema_id
  325. projectStatus: $projectStatus
  326. case_id: $case_id
  327. ) {
  328. projectStatus
  329. updatedAt
  330. createdAt
  331. projectName
  332. id
  333. projectType
  334. schema_id {
  335. updatedAt
  336. schemaState
  337. authWrite
  338. authReadObjects
  339. createdAt
  340. authRead
  341. schemaName
  342. reference
  343. id
  344. schemaData
  345. authReadWrite
  346. authWriteObjects
  347. }
  348. }
  349. }
  350. `;
  351. const CASE_AND_PROJECT = `
  352. query CASE_AND_PROJECT($user_id: ID, $projectType: String ) {
  353. caseProject:project_by_props(
  354. projectType: $projectType,
  355. user_id: "ioobot"
  356. ) {
  357. updatedAt
  358. apiGWGroup_id {
  359. id
  360. }
  361. createdAt
  362. projectName
  363. id
  364. projectType
  365. wxConfig_id {
  366. id
  367. appName
  368. }
  369. schema_id {
  370. schemaData
  371. schemaName
  372. id
  373. reference
  374. schemaState
  375. }
  376. }
  377. project:project_by_props(
  378. projectType: $projectType,
  379. user_id: $user_id
  380. ) {
  381. updatedAt
  382. apiGWGroup_id {
  383. id
  384. }
  385. createdAt
  386. projectName
  387. id
  388. case_id {
  389. id
  390. }
  391. projectType
  392. wxConfig_id {
  393. id
  394. appName
  395. }
  396. schema_id {
  397. id
  398. }
  399. }
  400. }
  401. `;
  402. const SHOW_PROJECT = `
  403. query PROJECT_BY_PROPS($projectType: String, $user_id: ID) {
  404. project:project_by_props(
  405. projectType: $projectType,
  406. user_id: $user_id
  407. ) {
  408. updatedAt
  409. apiGWGroup_id {
  410. id
  411. }
  412. createdAt
  413. projectName
  414. id
  415. case_id {
  416. id
  417. }
  418. projectType
  419. wxConfig_id {
  420. id
  421. }
  422. schema_id {
  423. id
  424. }
  425. }
  426. }
  427. `;
  428. const DELETE_PROJECT = `
  429. mutation DELETE_PROJECT($id: ID, $user_id: ID) {
  430. delete_project(id: $id, user_id: $user_id)
  431. }
  432. `;
  433. const SHOW_TABLE = `
  434. query TABLE($schema_id: ID!) {
  435. schema_by_id(id: $schema_id) {
  436. schemaData
  437. schemaName
  438. reference
  439. schemaState
  440. }
  441. }
  442. `;
  443. const ADD_CLOUD = `
  444. mutation CLOUD($id: ID!, $user_id: ID, $cloudName: String, $secretId: String, $secretKey: String, $updatedAt: String, $createdAt: String, $appId: String) {
  445. create_cloud(
  446. id: $id
  447. user_id: $user_id
  448. cloudName: $cloudName
  449. secretId: $secretId
  450. secretKey: $secretKey
  451. createdAt: $createdAt
  452. updatedAt: $updatedAt
  453. appId: $appId
  454. ) {
  455. id
  456. cloudName
  457. secretId
  458. secretKey
  459. appId
  460. }
  461. }
  462. `;
  463. const SHOW_CLOUD = `
  464. query CLOUD($user_id: ID!) {
  465. cloud_by_props(user_id: $user_id) {
  466. id
  467. cloudName
  468. secretId
  469. secretKey
  470. appId
  471. }
  472. }
  473. `;
  474. const UPDATE_CLOUD = `
  475. mutation updatecloud($id: ID, $secretId: String, $secretKey: String $updatedAt: String, $appId: String) {
  476. update_cloud(
  477. id: $id
  478. secretId: $secretId
  479. secretKey: $secretKey
  480. updatedAt: $updatedAt
  481. appId: $appId
  482. ) {
  483. id
  484. cloudName
  485. secretId
  486. secretKey
  487. appId
  488. }
  489. }
  490. `;
  491. const ADD_DEPLOY = `
  492. 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) {
  493. create_deploy(
  494. id: $id
  495. description: $description
  496. cosBucketName: $cosBucketName
  497. memorySize: $memorySize
  498. fc_id: $fc_id
  499. subnetId: $subnetId
  500. cosObjectName: $cosObjectName
  501. region: $region
  502. vpcId: $vpcId
  503. cosBucketRegion: $cosBucketRegion
  504. cloud_id: $cloud_id
  505. user_id: $user_id
  506. timeout: $timeout
  507. handler: $handler
  508. functionName: $functionName
  509. serviceName: $serviceName
  510. createdAt: $createdAt
  511. updatedAt: $updatedAt
  512. ) {
  513. id
  514. }
  515. }
  516. `;
  517. const UPDATE_DEPLOY = `
  518. mutation DEPLOY($id: ID!, $description: String, $updatedAt: String, $cosBucketName: String, $subnetId: String, $cosObjectName: String, $region: String, $vpcId: String, $cosBucketRegion: String, $functionName: String) {
  519. update_deploy(
  520. id: $id
  521. description: $description
  522. cosBucketName: $cosBucketName
  523. subnetId: $subnetId
  524. cosObjectName: $cosObjectName
  525. region: $region
  526. vpcId: $vpcId
  527. cosBucketRegion: $cosBucketRegion
  528. functionName: $functionName
  529. updatedAt: $updatedAt
  530. ) {
  531. id
  532. }
  533. }
  534. `;
  535. const SEARCH_APIGROUP = `
  536. query apiGWGroupbyid($id: ID) {
  537. apiGWGroupbyid: apiGWGroup_by_id(id: $id) {
  538. environmentName
  539. userStatus
  540. defaultDomain
  541. updatedAt
  542. userDomain
  543. groupName
  544. createdAt
  545. frontType
  546. region
  547. serviceId
  548. status
  549. id
  550. }
  551. }
  552. `;
  553. const SHOW_APIGROUP = `
  554. query apiGWGroupbyprops($user_id: ID, $groupName: String, $status: String) {
  555. apiGWGroupbyprops: apiGWGroup_by_props(user_id: $user_id, groupName: $groupName, status: $status) {
  556. environmentName
  557. userStatus
  558. defaultDomain
  559. updatedAt
  560. userDomain
  561. groupName
  562. createdAt
  563. frontType
  564. region
  565. serviceId
  566. status
  567. id
  568. cloud_id {
  569. cloudName
  570. }
  571. }
  572. }
  573. `;
  574. const ADD_APIGROUP = `
  575. 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) {
  576. create_apiGWGroup(
  577. id: $id
  578. userStatus: $userStatus
  579. defaultDomain: $defaultDomain
  580. updatedAt: $updatedAt
  581. userDomain: $userDomain
  582. groupName: $groupName
  583. createdAt: $createdAt
  584. frontType: $frontType
  585. region: $region
  586. status: $status
  587. cloud_id: $cloud_id
  588. user_id: $user_id
  589. environmentName: $environmentName
  590. serviceId: $serviceId
  591. ) {
  592. id
  593. userStatus
  594. }
  595. }
  596. `;
  597. const UPDATE_APIGROUP = `
  598. mutation GROUP($id:ID!, $environmentName: String, $userStatus: String, $updatedAt: String, $userDomain: String, $groupName: String, $frontType: String, $region: String, $status: String) {
  599. update_apiGWGroup(
  600. id: $id
  601. userStatus: $userStatus
  602. status: $status
  603. userDomain: $userDomain
  604. groupName: $groupName
  605. frontType: $frontType
  606. region: $region
  607. environmentName: $environmentName
  608. updatedAt: $updatedAt
  609. ) {
  610. id
  611. userStatus
  612. }
  613. }
  614. `;
  615. const DELETE_APIGROUP = `
  616. mutation deleteapiGWGroup($id: ID, $user_id: ID) {
  617. delete_apiGWGroup(id: $id user_id: $user_id)
  618. }
  619. `;
  620. const SHOW_APIGWPATH = `
  621. query PATH($apiGWGroup_id: ID!) {
  622. apiGWPath_by_props(apiGWGroup_id: $apiGWGroup_id) {
  623. id
  624. apiGWName
  625. apiGWDesc
  626. requestMethod
  627. apiGWPath
  628. }
  629. }
  630. `;
  631. const ADD_APIGWPATH = `
  632. 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) {
  633. create_apiGWPath(
  634. apiGWName: $apiGWName
  635. updatedAt: $updatedAt
  636. apiGWGroup_id: $apiGWGroup_id
  637. createdAt: $createdAt
  638. deploy_id: $deploy_id
  639. serviceType: $serviceType
  640. id: $id
  641. apiGWPath: $apiGWPath
  642. user_id: $user_id
  643. timeout: $timeout
  644. apiGWDesc: $apiGWDesc
  645. requestMethod: $requestMethod
  646. apiId: $apiId
  647. ) {
  648. id
  649. }
  650. }
  651. `;
  652. const UPDATE_APIGWPATH = `
  653. mutation PATH($apiGWName: String, $updatedAt: String, $apiGWDesc: String, $requestMethod: String) {
  654. update_apiGWPath(
  655. apiGWName: $apiGWName
  656. apiGWDesc: $apiGWDesc
  657. requestMethod: $requestMethod
  658. updatedAt: $updatedAt
  659. ) {
  660. id
  661. }
  662. }
  663. `;
  664. const DELETE_APIGWPATH = `
  665. mutation deleteapiGWPath($id: ID, $user_id: ID) {
  666. delete_apiGWPath(id: $id user_id: $user_id)
  667. }
  668. `;
  669. const SHOW_ALL_WXCONFIG = `
  670. query WXCONFIG($user_id: ID) {
  671. userWxConfig:wxConfig_by_props(user_id: $user_id) {
  672. appID
  673. appName
  674. appSecret
  675. attach
  676. body
  677. enter_url
  678. id
  679. mch_id
  680. notify_url
  681. pay_api_key
  682. spbill_create_ip
  683. token
  684. welcome_words
  685. }
  686. caseWxConfig:wxConfig_by_props(user_id: "ioobot") {
  687. appID
  688. appName
  689. appSecret
  690. attach
  691. body
  692. enter_url
  693. id
  694. mch_id
  695. notify_url
  696. pay_api_key
  697. spbill_create_ip
  698. token
  699. welcome_words
  700. }
  701. }
  702. `;
  703. const SHOW_WXCONFIG = `
  704. query WXCONFIG($user_id: ID) {
  705. wxConfig_by_props(user_id: $user_id) {
  706. appID
  707. appName
  708. appSecret
  709. attach
  710. body
  711. enter_url
  712. id
  713. mch_id
  714. notify_url
  715. pay_api_key
  716. spbill_create_ip
  717. token
  718. welcome_words
  719. }
  720. }
  721. `;
  722. const ADD_WXCONFIG = `
  723. mutation createwxConfig($updatedAt: String, $mch_id: String, $appName: String, $notify_url: String, $appSecret: String, $createdAt: String, $appID: String, $token: String, $spbill_create_ip: String, $enter_url: String, $id: ID!, $pay_api_key: String, $user_id: ID, $body: String, $welcome_words: String, $attach: String) {
  724. create_wxConfig(
  725. updatedAt: $updatedAt
  726. mch_id: $mch_id
  727. appName: $appName
  728. notify_url: $notify_url
  729. appSecret: $appSecret
  730. createdAt: $createdAt
  731. appID: $appID
  732. token: $token
  733. spbill_create_ip: $spbill_create_ip
  734. enter_url: $enter_url
  735. id: $id
  736. pay_api_key: $pay_api_key
  737. user_id: $user_id
  738. body: $body
  739. welcome_words: $welcome_words
  740. attach: $attach
  741. ) {
  742. mch_id
  743. appName
  744. notify_url
  745. appSecret
  746. appID
  747. token
  748. spbill_create_ip
  749. enter_url
  750. id
  751. pay_api_key
  752. body
  753. welcome_words
  754. attach
  755. }
  756. }
  757. `;
  758. const SHOW_WXCONTENT = `
  759. query wxConfigbyid($id: ID) {
  760. wxConfig_by_id(id: $id) {
  761. mch_id
  762. appName
  763. notify_url
  764. appSecret
  765. appID
  766. token
  767. spbill_create_ip
  768. enter_url
  769. id
  770. pay_api_key
  771. body
  772. welcome_words
  773. attach
  774. }
  775. }
  776. `;
  777. const UPDATE_WXCONFIG = `
  778. mutation updatewxConfig($id: ID, $updatedAt: String, $mch_id: String, $appName: String, $notify_url: String, $appSecret: String, $appID: String, $token: String, $spbill_create_ip: String, $enter_url: String, $pay_api_key: String, $body: String, $welcome_words: String, $attach: String) {
  779. update_wxConfig(
  780. id: $id
  781. updatedAt: $updatedAt
  782. mch_id: $mch_id
  783. appName: $appName
  784. notify_url: $notify_url
  785. appSecret: $appSecret
  786. appID: $appID
  787. token: $token
  788. spbill_create_ip: $spbill_create_ip
  789. enter_url: $enter_url
  790. pay_api_key: $pay_api_key
  791. body: $body
  792. welcome_words: $welcome_words
  793. attach: $attach
  794. ) {
  795. id
  796. mch_id
  797. appName
  798. notify_url
  799. appSecret
  800. appID
  801. token
  802. spbill_create_ip
  803. enter_url
  804. pay_api_key
  805. body
  806. welcome_words
  807. attach
  808. }
  809. }
  810. `;
  811. const DELETE_WXCONFIG = `
  812. mutation deletewxConfig($id: ID) {
  813. delete_wxConfig(id: $id)
  814. }
  815. `;
  816. const GET_PROJECT = `
  817. query projectbyid($id: ID) {
  818. project_by_id(id: $id) {
  819. updatedAt
  820. projectStatus
  821. database_id {
  822. id
  823. }
  824. apiGWGroup_id {
  825. id
  826. groupName
  827. region
  828. frontType
  829. defaultDomain
  830. userStatus
  831. userDomain
  832. serviceId
  833. environmentName
  834. }
  835. projectName
  836. deploy_id {
  837. description
  838. updatedAt
  839. cosBucketName
  840. memorySize
  841. createdAt
  842. subnetId
  843. cosObjectName
  844. region
  845. vpcId
  846. cosBucketRegion
  847. id
  848. serviceName
  849. timeout
  850. handler
  851. functionName
  852. }
  853. case_id {
  854. id
  855. }
  856. id
  857. projectType
  858. cloud_id {
  859. id
  860. cloudName
  861. secretId
  862. secretKey
  863. appId
  864. createdAt
  865. updatedAt
  866. }
  867. user_id {
  868. id
  869. }
  870. wxConfig_id {
  871. id
  872. updatedAt
  873. mch_id
  874. appName
  875. notify_url
  876. appSecret
  877. createdAt
  878. appID
  879. token
  880. spbill_create_ip
  881. enter_url
  882. id
  883. pay_api_key
  884. body
  885. welcome_words
  886. attach
  887. }
  888. schema_id {
  889. updatedAt
  890. schemaState
  891. createdAt
  892. schemaName
  893. reference
  894. id
  895. schemaData
  896. }
  897. notification_id {
  898. id
  899. type
  900. webhook
  901. name
  902. }
  903. }
  904. }
  905. `;
  906. const UPDATE_PROJECT_GROUP = `
  907. mutation updateproject($id: ID, $updatedAt: String, $apiGWGroup_id: ID, $projectStatus: String) {
  908. update_project(id: $id updatedAt: $updatedAt apiGWGroup_id: $apiGWGroup_id projectStatus: $projectStatus) {
  909. projectStatus
  910. updatedAt
  911. projectName
  912. id
  913. projectType
  914. }
  915. }
  916. `;
  917. const UPDATE_PROJECT_DEPLOY = `
  918. mutation updateproject($id: ID, $updatedAt: String, $deploy_id: ID, $projectStatus: String) {
  919. update_project(id: $id updatedAt: $updatedAt deploy_id: $deploy_id projectStatus: $projectStatus) {
  920. projectStatus
  921. updatedAt
  922. projectName
  923. id
  924. projectType
  925. }
  926. }
  927. `;
  928. const UPDATE_PROJECT_CLOUD = `
  929. mutation updateproject($id: ID, $updatedAt: String, $cloud_id: ID, $projectStatus: String) {
  930. update_project(id: $id updatedAt: $updatedAt cloud_id: $cloud_id projectStatus: $projectStatus) {
  931. projectStatus
  932. updatedAt
  933. projectName
  934. id
  935. projectType
  936. }
  937. }
  938. `;
  939. const UPDATE_PROJECT_DATABASE = `
  940. mutation updateproject($id: ID, $updatedAt: String, $database_id: ID, $projectStatus: String) {
  941. update_project(id: $id updatedAt: $updatedAt database_id: $database_id projectStatus: $projectStatus) {
  942. projectStatus
  943. updatedAt
  944. projectName
  945. id
  946. projectType
  947. }
  948. }
  949. `;
  950. const UPDATE_PROJECT_DEPLOY_AND_CLOUD = `
  951. mutation updateproject($id: ID, $updatedAt: String, $deploy_id: ID, $cloud_id: ID, $projectStatus: String) {
  952. update_project(id: $id updatedAt: $updatedAt deploy_id: $deploy_id cloud_id: $cloud_id projectStatus: $projectStatus) {
  953. projectStatus
  954. updatedAt
  955. projectName
  956. id
  957. projectType
  958. }
  959. }
  960. `;
  961. const UPDATE_PROJECT_ONLY_STATUS = `
  962. mutation updateproject($id: ID, $updatedAt: String, $projectStatus: String) {
  963. update_project(id: $id updatedAt: $updatedAt projectStatus: $projectStatus) {
  964. projectStatus
  965. updatedAt
  966. projectName
  967. id
  968. projectType
  969. }
  970. }
  971. `;
  972. const ADD_NOTIFICATION = `
  973. mutation createnotification($id: ID!, $type: String, $webhook: String, $name: String, $user_id: ID) {
  974. create_notification(id: $id type: $type webhook: $webhook name: $name user_id: $user_id) {
  975. id
  976. type
  977. webhook
  978. name
  979. user_id {
  980. id
  981. }
  982. }
  983. }
  984. `;
  985. const UPDATE_NOTIFICATION = `
  986. mutation updatenotification($id: ID, $type: String, $webhook: String, $name: String) {
  987. update_notification(id: $id type: $type webhook: $webhook name: $name) {
  988. id
  989. type
  990. webhook
  991. name
  992. }
  993. }
  994. `;
  995. const SHOW_CASE = `
  996. query CASE($id: ID!) {
  997. case_by_id(id: $id) {
  998. id
  999. schema_id {
  1000. id
  1001. }
  1002. img
  1003. detailDescription
  1004. detailImages
  1005. user_id {
  1006. id
  1007. nickname
  1008. email
  1009. }
  1010. detailAttention
  1011. codeAddress
  1012. }
  1013. }
  1014. `;
  1015. const SHOW_ALL_CASE = `
  1016. query CASE($user_id: ID) {
  1017. case_by_props(user_id: $user_id) {
  1018. id
  1019. img
  1020. deployedNum
  1021. title
  1022. description
  1023. user_id {
  1024. id
  1025. avatar
  1026. }
  1027. like
  1028. }
  1029. }
  1030. `;
  1031. export {
  1032. ADD_USER,
  1033. GET_USER,
  1034. SEARCH_USER,
  1035. UPDATE_USER,
  1036. SEARCH_SCHEMA,
  1037. ADD_SCHEMA,
  1038. SHOW_CASE_SCHEMA,
  1039. SHOW_ALL_SCHEMA,
  1040. SHOW_SCHEMA,
  1041. UPDATE_SCHEMA,
  1042. UPDATE_SCHEMA_PROJECT_NAME,
  1043. DELETE_SCHEMA,
  1044. DELETE_PROJECT,
  1045. SHOW_TABLE,
  1046. ADD_PROJECT_AND_SCHEMA,
  1047. CASE_AND_PROJECT,
  1048. SHOW_PROJECT,
  1049. ADD_CLOUD,
  1050. SHOW_CLOUD,
  1051. UPDATE_CLOUD,
  1052. ADD_DEPLOY,
  1053. UPDATE_DEPLOY,
  1054. SEARCH_APIGROUP,
  1055. SHOW_APIGROUP,
  1056. ADD_APIGROUP,
  1057. UPDATE_APIGROUP,
  1058. DELETE_APIGROUP,
  1059. SHOW_APIGWPATH,
  1060. ADD_APIGWPATH,
  1061. UPDATE_APIGWPATH,
  1062. DELETE_APIGWPATH,
  1063. ADD_PROJECT_AND_WX,
  1064. SHOW_ALL_WXCONFIG,
  1065. SHOW_WXCONFIG,
  1066. ADD_WXCONFIG,
  1067. SHOW_WXCONTENT,
  1068. UPDATE_WXCONFIG,
  1069. DELETE_WXCONFIG,
  1070. GET_PROJECT,
  1071. UPDATE_PROJECT_GROUP,
  1072. UPDATE_PROJECT_DEPLOY,
  1073. UPDATE_PROJECT_CLOUD,
  1074. UPDATE_PROJECT_DATABASE,
  1075. UPDATE_PROJECT_DEPLOY_AND_CLOUD,
  1076. UPDATE_PROJECT_ONLY_STATUS,
  1077. ADD_NOTIFICATION,
  1078. UPDATE_NOTIFICATION,
  1079. SHOW_CASE,
  1080. SHOW_ALL_CASE,
  1081. ADD_PROJECT
  1082. }