Second frontend, written in Next.JS + Typescript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
1.9 KiB

{"ast":null,"code":"import config from \"../../config\";\n\nclass GQLSSRClient {\n async post(query, variables, operationName) {\n const res = await fetch(config.apiUrl(\"/graphql\"), {\n body: JSON.stringify({\n query,\n variables,\n operationName\n }),\n credentials: \"include\",\n headers: {\n \"Content-Type\": \"application/json\"\n }\n });\n return await res.json();\n }\n\n}\n\nconst gqlSsrClient = new GQLSSRClient();\nexport default gqlSsrClient;","map":{"version":3,"sources":["/data/projects/react/rpdata-frontend2/lib/client/graphql-ssr.ts"],"names":["config","GQLSSRClient","post","query","variables","operationName","res","fetch","apiUrl","body","JSON","stringify","credentials","headers","json","gqlSsrClient"],"mappings":"AAAA,OAAOA,MAAP,MAAmB,cAAnB;;AAGA,MAAMC,YAAN,CAAwC;AACtC,QAAMC,IAAN,CAAWC,KAAX,EAA0BC,SAA1B,EAAyDC,aAAzD,EAAsG;AACpG,UAAMC,GAAG,GAAG,MAAMC,KAAK,CAACP,MAAM,CAACQ,MAAP,CAAc,UAAd,CAAD,EAA4B;AACjDC,MAAAA,IAAI,EAAEC,IAAI,CAACC,SAAL,CAAe;AAACR,QAAAA,KAAD;AAAQC,QAAAA,SAAR;AAAmBC,QAAAA;AAAnB,OAAf,CAD2C;AAEjDO,MAAAA,WAAW,EAAE,SAFoC;AAGjDC,MAAAA,OAAO,EAAE;AACP,wBAAgB;AADT;AAHwC,KAA5B,CAAvB;AAQA,WAAO,MAAMP,GAAG,CAACQ,IAAJ,EAAb;AACD;;AAXqC;;AAcxC,MAAMC,YAAY,GAAG,IAAId,YAAJ,EAArB;AACA,eAAec,YAAf","sourcesContent":["import config from \"../../config\";\nimport { GQLClient, GQLRespone } from \"./graphql\";\n\nclass GQLSSRClient implements GQLClient {\n async post(query: string, variables?: {[x:string]: any}, operationName?: string): Promise<GQLRespone> {\n const res = await fetch(config.apiUrl(\"/graphql\"), {\n body: JSON.stringify({query, variables, operationName}),\n credentials: \"include\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n });\n\n return await res.json();\n }\n}\n\nconst gqlSsrClient = new GQLSSRClient();\nexport default gqlSsrClient;"]},"metadata":{},"sourceType":"module"}