"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/hoppscotch-data/src/graphql/index.ts" between
hoppscotch-2.2.1.tar.gz and hoppscotch-3.0.0.tar.gz

About: Hoppscotch is a light-weight, web based API development suite.

index.ts  (hoppscotch-2.2.1):index.ts  (hoppscotch-3.0.0)
import { HoppGQLAuth } from "./HoppGQLAuth"
export * from "./HoppGQLAuth"
export const GQL_REQ_SCHEMA_VERSION = 2
export type GQLHeader = { export type GQLHeader = {
key: string key: string
value: string value: string
active: boolean active: boolean
} }
export type HoppGQLRequest = { export type HoppGQLRequest = {
v: number v: number
name: string name: string
url: string url: string
headers: GQLHeader[] headers: GQLHeader[]
query: string query: string
variables: string variables: string
auth: HoppGQLAuth
} }
export function translateToGQLRequest(x: any): HoppGQLRequest { export function translateToGQLRequest(x: any): HoppGQLRequest {
if (x.v && x.v === 1) return x if (x.v && x.v === GQL_REQ_SCHEMA_VERSION) return x
// Old request // Old request
const name = x.name ?? "Untitled" const name = x.name ?? "Untitled"
const url = x.url ?? "" const url = x.url ?? ""
const headers = x.headers ?? [] const headers = x.headers ?? []
const query = x.query ?? "" const query = x.query ?? ""
const variables = x.variables ?? [] const variables = x.variables ?? []
const auth = x.auth ?? {
authType: "none",
authActive: true,
}
return { return {
v: 1, v: GQL_REQ_SCHEMA_VERSION,
name, name,
url, url,
headers, headers,
query, query,
variables, variables,
auth
} }
} }
export function makeGQLRequest(x: Omit<HoppGQLRequest, "v">) { export function makeGQLRequest(x: Omit<HoppGQLRequest, "v">): HoppGQLRequest {
return { return {
v: 1, v: GQL_REQ_SCHEMA_VERSION,
...x, ...x,
} }
} }
 End of changes. 8 change blocks. 
4 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)