netlify-onegraph-internal
Advanced tools
Comparing version 0.8.2 to 0.8.3
@@ -78,3 +78,3 @@ import * as GraphQLPackage from "graphql"; | ||
export declare function typeScriptSignatureForOperation(GraphQL: typeof GraphQLPackage, schema: GraphQLSchema, operationDefinition: OperationDefinitionNode, fragmentDefinitions: Record<string, FragmentDefinitionNode>): string; | ||
export declare function typeScriptDefinitionObjectForFragment(GraphQL: typeof GraphQLPackage, schema: GraphQLSchema, fragmentDefinition: FragmentDefinitionNode, fragmentDefinitions: Record<string, FragmentDefinitionNode>): OutObject | OutScalar | OutUnion; | ||
export declare function typeScriptDefinitionObjectForFragment(GraphQL: typeof GraphQLPackage, schema: GraphQLSchema, fragmentDefinition: FragmentDefinitionNode, fragmentDefinitions: Record<string, FragmentDefinitionNode>): OutObject | OutScalar | OutUnion | OutInterface; | ||
export declare function typeScriptSignatureForFragment(GraphQL: typeof GraphQLPackage, schema: GraphQLSchema, fragmentDefinition: FragmentDefinitionNode, fragmentDefinitions: Record<string, FragmentDefinitionNode>): string; | ||
@@ -81,0 +81,0 @@ export declare function typeScriptTypeNameForOperation(name: string): string; |
@@ -85,3 +85,9 @@ import { DocumentNode, FragmentDefinitionNode, GraphQLSchema, OperationDefinitionNode, OperationTypeNode } from "graphql"; | ||
}; | ||
export declare const generateJavaScriptClient: (GraphQL: typeof GraphQLPackage, netlifyGraphConfig: NetlifyGraphConfig, schema: GraphQLSchema, operationsDoc: string, enabledFunctions: ParsedFunction[]) => string; | ||
export declare const generateJavaScriptClient: ({ GraphQL, netlifyGraphConfig, schema, operationsDoc, enabledFunctions, }: { | ||
GraphQL: typeof GraphQLPackage; | ||
netlifyGraphConfig: NetlifyGraphConfig; | ||
schema: GraphQLSchema; | ||
operationsDoc: string; | ||
enabledFunctions: ParsedFunction[]; | ||
}) => string; | ||
export declare const generateProductionJavaScriptClient: (GraphQL: typeof GraphQLPackage, netlifyGraphConfig: NetlifyGraphConfig, schema: GraphQLSchema, operationsDoc: string, enabledFunctions: PersistedFunction[], schemaId: string) => string; | ||
@@ -88,0 +94,0 @@ export declare const generateFragmentTypeScriptDefinition: (netlifyGraphConfig: NetlifyGraphConfig, schema: GraphQLSchema, fragment: ParsedFragment) => string; |
@@ -42,8 +42,10 @@ "use strict"; | ||
var GraphQL = require("graphql"); | ||
var internalConsole_1 = require("./internalConsole"); | ||
var index_1 = require("./index"); | ||
var test = function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var sourceGraphQLFilename, schemaGraphQLFilename, sourceGraphQLFile, schemaGraphQLFile, schema, parsedDoc, _a, functions, fragments, netlifyGraphConfig, result, _b, clientSource, typeDefinitionsSource, sourcePath, typeDefinitionsSourcePath; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
var sourceGraphQLFilename, schemaGraphQLFilename, sourceGraphQLFile, schemaGraphQLFile, schema, parsedDoc, _a, functions, fragments, netlifyGraphConfig, result, clientSource, typeDefinitionsSource, sourcePath, typeDefinitionsSourcePath; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
(0, internalConsole_1.registerConsole)(console); | ||
sourceGraphQLFilename = "./tests/assets/netlifyGraphOperationsLibrary.graphql"; | ||
@@ -84,13 +86,12 @@ schemaGraphQLFilename = "./tests/assets/netlifyGraphSchema.graphql"; | ||
}; | ||
result = index_1.NetlifyGraph.generateFunctionsSource(GraphQL, netlifyGraphConfig, schema, sourceGraphQLFile, functions, fragments); | ||
return [4 /*yield*/, index_1.NetlifyGraph.generateFunctionsSource(GraphQL, netlifyGraphConfig, schema, sourceGraphQLFile, functions, fragments)]; | ||
case 1: | ||
result = _b.sent(); | ||
if (!result) { | ||
throw new Error("result is undefined"); | ||
} | ||
return [4 /*yield*/, result]; | ||
case 1: | ||
_b = _c.sent(), clientSource = _b.clientSource, typeDefinitionsSource = _b.typeDefinitionsSource; | ||
console.log(typeDefinitionsSource); | ||
sourcePath = "/Users/s/code/gravity/gravity/netlify/functions/netlifyGraph/index.js"; | ||
clientSource = result.clientSource, typeDefinitionsSource = result.typeDefinitionsSource; | ||
sourcePath = "/tmp/index.js"; | ||
(0, fs_1.writeFileSync)(sourcePath, clientSource[0]); | ||
typeDefinitionsSourcePath = "/Users/s/code/gravity/gravity/netlify/functions/netlifyGraph/index.d.ts"; | ||
typeDefinitionsSourcePath = "/tmp/index.d.ts"; | ||
(0, fs_1.writeFileSync)(typeDefinitionsSourcePath, typeDefinitionsSource); | ||
@@ -97,0 +98,0 @@ return [2 /*return*/]; |
@@ -8,3 +8,5 @@ "use strict"; | ||
var index_1 = require("./index"); | ||
var internalConsole_1 = require("./internalConsole"); | ||
var test = function () { | ||
(0, internalConsole_1.registerConsole)(console); | ||
var sourceGraphQLFilename = "./tests/assets/netlifyGraphOperationsLibrary.graphql"; | ||
@@ -17,2 +19,3 @@ var schemaGraphQLFilename = "./tests/assets/netlifyGraphSchema.graphql"; | ||
var functions = index_1.NetlifyGraph.extractFunctionsFromOperationDoc(GraphQL, parsedDoc); | ||
console.log("functions:", functions); | ||
var netlifyGraphConfig = { | ||
@@ -47,3 +50,3 @@ netlifyGraphPath: ["..", "..", "lib", "netlifyGraph"], | ||
netlifyGraphConfig: netlifyGraphConfig, | ||
operationId: "c67c5c11-cbc4-48ed-8ac8-2803a4e4dc5f", | ||
operationId: "5c7bb879-a810-4a7e-8aec-55d05fd9c172", | ||
operationsDoc: sourceGraphQLFile, | ||
@@ -59,3 +62,3 @@ schema: schema, | ||
? path.join.apply(path, exportedFile.name) : "default"; | ||
var contentPath = "/Users/s/code/gravity/gravity/netlify/functions/" + filename + ".ts"; | ||
var contentPath = "/tmp/" + filename + ".ts"; | ||
console.log(contentPath + ":\n", exportedFile.content); | ||
@@ -62,0 +65,0 @@ (0, fs_1.writeFileSync)(contentPath, exportedFile.content); |
{ | ||
"name": "netlify-onegraph-internal", | ||
"version": "0.8.2", | ||
"version": "0.8.3", | ||
"description": "Internal tools for use by Netlify", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
601928
7761