diff --git a/src/resolvers/cargoBikeResolver.ts b/src/resolvers/cargoBikeResolver.ts index 27542dd..b90b372 100644 --- a/src/resolvers/cargoBikeResolver.ts +++ b/src/resolvers/cargoBikeResolver.ts @@ -163,10 +163,10 @@ export default { }, NumRange: { min: (parent: string) => { - return parent.split(',')[0].replace('[', ''); + return parent.replace(/^\[(.*),.*]$/, '$1'); }, max: (parent: string) => { - return parent.split(',')[1].replace(']', ''); + return parent.replace(/^\[.*,(.*)]$/, '$1'); } }, Equipment: { diff --git a/src/resolvers/lendingStationResolvers.ts b/src/resolvers/lendingStationResolvers.ts index f17d87f..91d25bb 100644 --- a/src/resolvers/lendingStationResolvers.ts +++ b/src/resolvers/lendingStationResolvers.ts @@ -106,11 +106,10 @@ export default { }, DateRange: { from (parent: string) { - return parent.split(',')[0].replace('[', ''); + return parent.replace(/^\[(.*),.*\)$/, '$1'); }, to (parent: string) { - const str = parent.split(',')[1].replace(')', ''); - return (str.length > 0) ? str : null; + return parent.replace(/^\[.*,(.*)\)$/, '$1'); } }, TimeFrame: {