Skip to content

Commit c56fba2

Browse files
raxrax
authored andcommitted
flow
1 parent 1fdf9d3 commit c56fba2

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/types.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import type {GraphQLOutputType, GraphQLInputType} from 'flow/type/definition.js.flow';
2+
3+
type Param = {
4+
type: string,
5+
name: string
6+
}
7+
8+
type EndpointParam = {
9+
type: string,
10+
name: string,
11+
jsonSchema: string
12+
}
13+
14+
export type GraphQLParameters = {[string]: any};
15+
16+
export type Endpoint = {
17+
parameters: Array<EndpointParam>,
18+
description?: string,
19+
response: Object,
20+
request: (args:GraphQLParameters, url: string) => Object,
21+
mutation: boolean
22+
}
23+
24+
export type GraphQLType = GraphQLOutputType | GraphQLInputType;
25+
26+
export type Responses = {
27+
[string|number] : {
28+
schema?: Object
29+
}
30+
};
31+
32+
export type JSONSchemaType = {
33+
$ref?: string,
34+
schema?: JSONSchemaType,
35+
type?: string,
36+
properties?: Array<string>
37+
}
38+
39+
export type SwaggerSchema = {
40+
paths: {
41+
[string]: {
42+
description?: string,
43+
operationId?: string,
44+
parameters?: Array<Param>,
45+
responses: Responses
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)