• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

thoughtspot / rise / #363

28 May 2025 06:00AM UTC coverage: 0.0% (-85.8%) from 85.769%
#363

push

sagar1993
Add gqlVariables to gqlResolver

0 of 113 branches covered (0.0%)

Branch coverage included in aggregate %.

0 of 5 new or added lines in 2 files covered. (0.0%)

144 existing lines in 4 files now uncovered.

0 of 162 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/index.ts
1
/* eslint-disable no-underscore-dangle */
UNCOV
2
import { mapSchema, getDirective, MapperKind } from '@graphql-tools/utils';
×
3
import _ from 'lodash';
UNCOV
4
import { RiseDirectiveOptionsRest, restResolver } from './rest-resolver';
×
UNCOV
5
import { RiseDirectiveOptionsGql, gqlResolver } from './gql-resolver';
×
UNCOV
6
import { RestError } from './common';
×
7

UNCOV
8
export const getRiseDirectiveTypeDefs = (name: string) => `
×
9
  scalar JSON
10
  input RiseSetter {
11
    field: String
12
    path: String!
13
  }
14
  directive @${name}(path: String!, method: String, headers: JSON, 
15
    setters: [RiseSetter], resultroot: String, postbody: String,
16
    forwardheaders: [String], contenttype: String) on FIELD_DEFINITION
17
`;
18

UNCOV
19
export const getGqlRiseDirectiveTypeDefs = (name: string) => `
×
20
  input RiseGQLArgWrapper {
21
    name: String!
22
    type: String!
23
  }
24
  directive @${name}(argwrapper: RiseGQLArgWrapper, gqlVariables: String) on FIELD_DEFINITION
25
`;
26

27
type RiseDirectiveOptions = RiseDirectiveOptionsRest | RiseDirectiveOptionsGql;
28

UNCOV
29
export function rise(
×
30
  opts: Partial<RiseDirectiveOptions> = {},
×
31
) {
UNCOV
32
  const options: RiseDirectiveOptions = {
×
33
    name: 'rise', apiType: 'rest', baseURL: '', contenttype: '', headers: {}, forwardheaders: [], resultroot: undefined, errorroot: undefined, ErrorClass: RestError, ...opts,
34
  };
UNCOV
35
  return {
×
36
    riseDirectiveTypeDefs: options.apiType === 'gql' ? getGqlRiseDirectiveTypeDefs(options.name) : getRiseDirectiveTypeDefs(options.name),
×
UNCOV
37
    riseDirectiveTransformer: (schema) => mapSchema(schema, {
×
38
      [MapperKind.OBJECT_FIELD]: (fieldConfig) => {
UNCOV
39
        const riseDirective = getDirective(schema, fieldConfig, options.name)?.[0];
×
UNCOV
40
        if (riseDirective) {
×
UNCOV
41
          if (options.apiType === 'gql') {
×
UNCOV
42
            gqlResolver(riseDirective, options, fieldConfig);
×
43
          } else {
UNCOV
44
            restResolver(riseDirective, options, fieldConfig);
×
45
          }
46
        }
47

UNCOV
48
        return fieldConfig;
×
49
      },
50
    }),
51
  };
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc