Skip to content

Commit 96a5b13

Browse files
authored
Fix CORS methods type definition (#115)
Fix the CORS methods type definitions to allow scalar or array for all methods.
1 parent 7f0e2e2 commit 96a5b13

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

index.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ declare module "moleculer-apollo-server" {
1717
defaultPlaygroundOptions,
1818
} from "apollo-server-core";
1919

20-
export { GraphQLUpload } from 'graphql-upload';
20+
export { GraphQLUpload } from "graphql-upload";
2121

2222
export * from "graphql-tools";
2323

@@ -50,9 +50,11 @@ declare module "moleculer-apollo-server" {
5050
};
5151
}
5252

53+
type CorsMethods = "GET" | "POST" | "PUT" | "DELETE" | "OPTIONS";
54+
5355
export interface ServiceRouteCorsOptions {
5456
origin?: string | string[];
55-
methods?: "GET" | "POST" | "PUT" | "DELETE" | "OPTIONS"[];
57+
methods?: CorsMethods | CorsMethods[];
5658
allowedHeaders?: string[];
5759
exposedHeaders?: string[];
5860
credentials?: boolean;

0 commit comments

Comments
 (0)