Add Form Support
This commit is contained in:
16
app/plugins/graphql.ts
Normal file
16
app/plugins/graphql.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { GraphQLClient } from "graphql-request";
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
const config=useRuntimeConfig();
|
||||
|
||||
const endpoint = process.server
|
||||
? config.graphqlEndpoint
|
||||
: config.public.graphqlEndpoint
|
||||
|
||||
const client = new GraphQLClient(endpoint);
|
||||
return {
|
||||
provide: {
|
||||
gql: client
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user