Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"express": "^4.17.1",
"jest": "^29.3.1",
"prettier": "^2.3.0",
"semver": "^7.4.0",
"sqlite3": "^5.0.2"
}
}
3 changes: 2 additions & 1 deletion test/resources/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"files": [
"./bookshop-graphql/srv/admin-service.cds",
"./bookshop-graphql/srv/cat-service.cds"
]
],
"requires_cds": ">=6.8.0"
},
{
"name": "types",
Expand Down
24 changes: 24 additions & 0 deletions test/schemas/bookshop-graphql.gql
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ input AdminService_Chapters_orderBy {
type AdminService_Currencies {
code: String
descr: String
minorUnit: Int16
name: String
symbol: String
texts(
Expand All @@ -403,6 +404,7 @@ type AdminService_Currencies {
input AdminService_Currencies_C {
code: String
descr: String
minorUnit: Int16
name: String
symbol: String
texts: [AdminService_Currencies_texts_C]
Expand All @@ -411,6 +413,7 @@ input AdminService_Currencies_C {
input AdminService_Currencies_U {
code: String
descr: String
minorUnit: Int16
name: String
symbol: String
texts: [AdminService_Currencies_texts_U]
Expand All @@ -424,6 +427,7 @@ type AdminService_Currencies_connection {
input AdminService_Currencies_filter {
code: [String_filter]
descr: [String_filter]
minorUnit: [Int16_filter]
name: [String_filter]
symbol: [String_filter]
}
Expand All @@ -444,6 +448,7 @@ type AdminService_Currencies_input {
input AdminService_Currencies_orderBy {
code: SortDirection
descr: SortDirection
minorUnit: SortDirection
name: SortDirection
symbol: SortDirection
}
Expand Down Expand Up @@ -935,6 +940,7 @@ input CatalogService_Chapters_orderBy {
type CatalogService_Currencies {
code: String
descr: String
minorUnit: Int16
name: String
symbol: String
texts(
Expand All @@ -948,6 +954,7 @@ type CatalogService_Currencies {
input CatalogService_Currencies_C {
code: String
descr: String
minorUnit: Int16
name: String
symbol: String
texts: [CatalogService_Currencies_texts_C]
Expand All @@ -956,6 +963,7 @@ input CatalogService_Currencies_C {
input CatalogService_Currencies_U {
code: String
descr: String
minorUnit: Int16
name: String
symbol: String
texts: [CatalogService_Currencies_texts_U]
Expand All @@ -969,6 +977,7 @@ type CatalogService_Currencies_connection {
input CatalogService_Currencies_filter {
code: [String_filter]
descr: [String_filter]
minorUnit: [Int16_filter]
name: [String_filter]
symbol: [String_filter]
}
Expand All @@ -989,6 +998,7 @@ type CatalogService_Currencies_input {
input CatalogService_Currencies_orderBy {
code: SortDirection
descr: SortDirection
minorUnit: SortDirection
name: SortDirection
symbol: SortDirection
}
Expand Down Expand Up @@ -1315,6 +1325,20 @@ input Decimal_filter {
ne: [Decimal]
}

"""
The `Int16` scalar type represents 16-bit non-fractional signed whole numeric values. Int16 can represent values between -(2^15) and 2^15 - 1.
"""
scalar Int16

input Int16_filter {
eq: [Int16]
ge: [Int16]
gt: [Int16]
le: [Int16]
lt: [Int16]
ne: [Int16]
}

input Int_filter {
eq: [Int]
ge: [Int]
Expand Down
7 changes: 6 additions & 1 deletion test/tests/schema.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
const fs = require('fs')
const path = require('path')
const { models } = require('../resources')
const semver = require('semver')
const cdsVersion = require('@sap/cds').version

let { models } = require('../resources')
models = models.filter(m => !m.requires_cds || semver.satisfies(cdsVersion, m.requires_cds))

const { SCHEMAS_DIR, cdsFilesToGQLSchema, formatSchema } = require('../util')
const { printSchema, validateSchema } = require('graphql')

Expand Down