@prisma/engine-core
Advanced tools
Comparing version 0.0.29 to 0.0.30
@@ -0,15 +1,15 @@ | ||
export declare type Fetcher = (input: { | ||
query: string; | ||
typeName?: string; | ||
}) => Promise<{ | ||
data?: any; | ||
error?: any; | ||
errors?: any; | ||
}>; | ||
interface EngineConfig { | ||
url?: string; | ||
fetcher?: (query: string) => Promise<{ | ||
data?: any; | ||
error?: any; | ||
errors?: any; | ||
}>; | ||
fetcher?: Fetcher; | ||
} | ||
export declare class BrowserEngine { | ||
fetcher: (query: string) => Promise<{ | ||
data?: any; | ||
error?: any; | ||
errors?: any; | ||
}>; | ||
fetcher: Fetcher; | ||
url?: string; | ||
@@ -19,4 +19,7 @@ constructor({ fetcher }: EngineConfig); | ||
stop(): Promise<void>; | ||
defaultFetcher: (query: string) => Promise<any>; | ||
request<T>(query: string): Promise<T>; | ||
defaultFetcher: ({ query, typeName }: { | ||
query: string; | ||
typeName?: string; | ||
}) => Promise<any>; | ||
request<T>(query: string, typeName?: string): Promise<T>; | ||
handleErrors({ errors, query }: { | ||
@@ -23,0 +26,0 @@ errors?: any; |
@@ -6,3 +6,3 @@ "use strict"; | ||
constructor({ fetcher }) { | ||
this.defaultFetcher = async (query) => { | ||
this.defaultFetcher = async ({ query, typeName }) => { | ||
return fetch(this.url, { | ||
@@ -46,4 +46,4 @@ method: 'POST', | ||
async stop() { } | ||
async request(query) { | ||
return this.fetcher(query).then(result => { | ||
async request(query, typeName) { | ||
return this.fetcher({ query, typeName }).then(result => { | ||
const { data } = result; | ||
@@ -50,0 +50,0 @@ const errors = result.error || result.errors; |
{ | ||
"name": "@prisma/engine-core", | ||
"version": "0.0.29", | ||
"version": "0.0.30", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
38673
639
4