apollo-graphql
Advanced tools
Comparing version
@@ -18,3 +18,3 @@ "use strict"; | ||
const schemaConfig = schema.toConfig(); | ||
return new graphql_1.GraphQLSchema(Object.assign(Object.assign({}, schemaConfig), { types: Object.values(typeMap), query: replaceMaybeType(schemaConfig.query), mutation: replaceMaybeType(schemaConfig.mutation), subscription: replaceMaybeType(schemaConfig.subscription) })); | ||
return new graphql_1.GraphQLSchema(Object.assign(Object.assign({}, schemaConfig), { types: Object.values(typeMap), query: replaceMaybeType(schemaConfig.query), mutation: replaceMaybeType(schemaConfig.mutation), subscription: replaceMaybeType(schemaConfig.subscription), directives: replaceDirectives(schemaConfig.directives) })); | ||
function recreateNamedType(type) { | ||
@@ -64,4 +64,10 @@ if (graphql_1.isObjectType(type)) { | ||
} | ||
function replaceDirectives(directives) { | ||
return directives.map(directive => { | ||
const config = directive.toConfig(); | ||
return new graphql_1.GraphQLDirective(Object.assign(Object.assign({}, config), { args: replaceArgs(config.args) })); | ||
}); | ||
} | ||
} | ||
exports.transformSchema = transformSchema; | ||
//# sourceMappingURL=transformSchema.js.map |
{ | ||
"name": "apollo-graphql", | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"description": "Apollo GraphQL utility library", | ||
@@ -47,3 +47,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "7b9d6d4f5e00789d17be2528f73b59c263998d25" | ||
"gitHead": "c4cbd4f81512321d8806dd3199c948d2669987d0" | ||
} |
@@ -22,3 +22,4 @@ import { | ||
GraphQLInputObjectType, | ||
GraphQLInputFieldConfigMap | ||
GraphQLInputFieldConfigMap, | ||
GraphQLDirective | ||
} from "graphql"; | ||
@@ -57,3 +58,4 @@ import { mapValues } from "../utilities/mapValues"; | ||
mutation: replaceMaybeType(schemaConfig.mutation), | ||
subscription: replaceMaybeType(schemaConfig.subscription) | ||
subscription: replaceMaybeType(schemaConfig.subscription), | ||
directives: replaceDirectives(schemaConfig.directives) | ||
}); | ||
@@ -150,2 +152,12 @@ | ||
} | ||
function replaceDirectives(directives: GraphQLDirective[]) { | ||
return directives.map(directive => { | ||
const config = directive.toConfig(); | ||
return new GraphQLDirective({ | ||
...config, | ||
args: replaceArgs(config.args) | ||
}); | ||
}); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
106293
1.52%2316
1.53%