Skip to content

Commit

Permalink
cds graphQL now works fully
Browse files Browse the repository at this point in the history
  • Loading branch information
jung-thomas committed Jan 11, 2022
1 parent 21d64e8 commit 5f63b66
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"date": "2022-01-11",
"version": "2.202201.9",
"Changed": [
"Update the Web UI Web Asssistant feature to work with the experimental SAP Horizon theme"
"Update the Web UI Web Asssistant feature to work with the experimental SAP Horizon theme",
"GraphQL option of cds command now fully works and cross references entity name in the exit correctly"
]
},
{
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/).

## [2.202201.9] - 2022-01-11

**Changed**

- Update the Web UI Web Asssistant feature to work with the experimental SAP Horizon theme
- GraphQL option of cds command now fully works and cross references entity name in the exit correctly

## [2.202201.8] - 2022-01-10

**Changed**
Expand Down
9 changes: 7 additions & 2 deletions bin/cds.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,13 @@ async function cdsServerSetup(prompts, cdsSource) {

let odataURL = "/odata/v4/opensap.hana.CatalogService/"
let entity = prompts.table
base.debug(`Entity Before ${entity}`)
entity = entity.replace(/\./g, "_")
entity = entity.replace(/::/g, "_")

let graphQLEntity = entity.replace(/_/g, ".")
base.debug(`GraphQL Entity After ${graphQLEntity}`)
// entity = entity.replace(/:/g, "")

// @ts-ignore
cds.serve('all').from(await cds.parse(cdsSource), {
crashOnError: false
Expand All @@ -222,7 +225,9 @@ async function cdsServerSetup(prompts, cdsSource) {
.to('fiori')

.with(srv => {
srv.on(['READ'], entity, async (req) => {
// @ts-ignore
srv.on(['READ'], [entity, `HanaCli.${graphQLEntity}`, "HanaCli.STAR.WARS.FILM"], async (req) => {
base.debug(`In Read Exit ${prompts.table}`)
// @ts-ignore
req.query.SELECT.from.ref = [`${prompts.table}`]

Expand Down

0 comments on commit 5f63b66

Please sign in to comment.