| //Module Imports for Functionality
|
| //import Image from 'next/image'
|
| import React from "react";
|
| import { Client, cacheExchange, fetchExchange } from 'urql';
|
| import { gql, useMutation } from '@apollo/client';
|
| import { useQuery } from 'urql';
|
| import { createClient, Provider } from 'urql';
|
| const fs = require("fs");
|
|
|
| //const graphQl = require('./graphQlQueries/GetAuthToken.gql');
|
| export default function Home() {
|
| return (
|
| <main>
|
| Hello World!
|
| <MyComponent />
|
| </main>
|
| )
|
| }
|
|
|
| // Module Library Imports - Consume Data, Functions, and Definitions from Other Libraries for Use in your Application.
|
| const jsonWebtoken = require("jsonwebtoken");
|
| const bcrypt = require("bcrypt");
|
|
|
| // Create URL Connection to graphQL
|
| const client = new Client({
|
| url: 'http://localhost:4000/graphql',
|
| exchanges: [cacheExchange, fetchExchange],
|
| });
|
|
|
| // GraphQL Mutation Query
|
| const graphQLQuery = gql`
|
| mutation ($email: String!, $password: String!) {
|
| login(email: $email, password: $password) {
|
| token
|
| }
|
| }`;
|
|
|
| export function Fun() {
|
| console.log("Fun Called!")
|
| const [result] = useQuery({
|
| query: 'graphQl',
|
| })};
|
|
|
| export function MyComponent() {
|
| const handleClick = () => {
|
| console.log("Tested!")
|
| alert("Clicked!");
|
| Fun();
|
| }
|
|
|
| return (
|
| <button onClick={handleClick}>Click Me!</button>
|
| );
|
| }
|