File tree Expand file tree Collapse file tree 3 files changed +44
-41
lines changed
Expand file tree Collapse file tree 3 files changed +44
-41
lines changed Original file line number Diff line number Diff line change 4141 "@nuxt/kit" : " 3.14.1592" ,
4242 "@pinia/nuxt" : " 0.9.0" ,
4343 "gql-query-builder" : " 3.8.0" ,
44- "graphql" : " 16.9 .0" ,
44+ "graphql" : " 16.10 .0" ,
4545 "graphql-tag" : " 2.12.6" ,
46- "graphql-tools" : " 9.0.6 " ,
46+ "graphql-tools" : " 9.0.8 " ,
4747 "graphql-ws" : " 5.16.0" ,
48+ "js-sha256" : " 0.11.0" ,
4849 "jwt-decode" : " 4.0.0" ,
49- "nuxi" : " 3.16.0 " ,
50+ "nuxi" : " 3.17.1 " ,
5051 "nuxt-graphql-request" : " ^8.1.1" ,
5152 "vue" : " 3.5.13"
5253 },
5556 "@nuxt/module-builder" : " 0.8.4" ,
5657 "@nuxt/schema" : " 3.14.1592" ,
5758 "@nuxt/test-utils" : " 3.15.1" ,
58- "@types/node" : " 22.10.1 " ,
59+ "@types/node" : " 22.10.2 " ,
5960 "eslint" : " 8.57.1" ,
6061 "nuxt" : " 3.14.1592" ,
6162 "prettier" : " 3.4.2" ,
Original file line number Diff line number Diff line change 11import { buildClientSchema , getIntrospectionQuery } from 'graphql' ;
2+ import { sha256 } from 'js-sha256' ;
23import { ofetch } from 'ofetch' ;
34
45import type { GraphQLMeta } from '../../generate' ;
@@ -10,7 +11,7 @@ export async function loadMeta(config: Partial<{ public: { host: string; schema?
1011 setTimeout ( ( ) => controller . abort ( ) , 5000 ) ;
1112
1213 return new Promise ( async ( resolve , reject ) => {
13- const { data : result } = await ofetch ( config . public . gqlHost , {
14+ const { data : result } = await ofetch ( config . public ? .gqlHost , {
1415 body : JSON . stringify ( {
1516 query : getIntrospectionQuery ( { descriptions : false } ) ,
1617 variables : { } ,
@@ -30,14 +31,9 @@ export async function loadMeta(config: Partial<{ public: { host: string; schema?
3031
3132/**
3233 * Hash a string with SHA-256
33- * see https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest#converting_a_digest_to_a_hex_string
3434 */
3535export async function hash ( string : string ) : Promise < string > {
36- const utf8 = new TextEncoder ( ) . encode ( string ) ;
37- const hashBuffer = await crypto . subtle . digest ( 'SHA-256' , utf8 ) ;
38- const hashArray = Array . from ( new Uint8Array ( hashBuffer ) ) ;
39- const hashHex = hashArray . map ( ( bytes ) => bytes . toString ( 16 ) . padStart ( 2 , '0' ) ) . join ( '' ) ;
40- return hashHex ;
36+ return sha256 ( string ) ;
4137}
4238
4339/**
You can’t perform that action at this time.
0 commit comments