Skip to content

Commit

Permalink
Fixing build error
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshit176022 committed Jan 16, 2025
1 parent ab76ce1 commit 9d4a88f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
31 changes: 30 additions & 1 deletion apollo-server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,29 @@ const typeDefs = gql`
about: String
}
type BlogPost {
id: ID!
blog_title: String!
image: String!
author: String!
tags: [String!]!
description: String!
mdfile: String!
}
type Gallery {
id: ID!
image: String!
event: String
title: String
desc: String
set: String
}
type Query {
members: [Member]
blogPosts: [BlogPost]
gallery: [Gallery]
}
`;

Expand All @@ -32,12 +53,20 @@ const resolvers = {
const { profileDetails } = await import(pathToFileURL(path.resolve(__dirname, './data/member_data.mjs')).href);
return profileDetails;
},
blogPosts: async () => {
const { blogData } = await import(pathToFileURL(path.resolve(__dirname, './data/blog_posts.mjs')).href);
return blogData;
},
gallery: async () => {
const { data } = await import(pathToFileURL(path.resolve(__dirname, './data/data.mjs')).href);
return data;
},
},
};

const app = express();
app.use(cors({
origin: '*', // Allow all origins for development
origin: '*',
}));

const startApolloServer = async () => {
Expand Down
7 changes: 1 addition & 6 deletions src/app/members/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ import Footer from '../../components/footer';
import Loader from "../../components/loader";
import SkeletonLoader from "../../components/skeltonloader";

// Apollo Client setup
const client = new ApolloClient({
uri: process.env.GRAPH_QL_URI || 'http://localhost:4000/graphql', // Make sure this matches your server's URL
uri: process.env.GRAPH_QL_URI || 'https://images.istenith.com/graphql/',
cache: new InMemoryCache(),
});

// GraphQL Query
const GET_MEMBERS = gql`
query GetMembers {
members {
Expand All @@ -40,13 +38,11 @@ const Team = () => {
const [showImage, setShowImage] = useState(false);
const [isLoading, setIsLoading] = useState(true);

// Apollo query hook
const { loading, error, data } = useQuery(GET_MEMBERS, {
client,
fetchPolicy: 'cache-and-network',
});

// Scroll progress animation
const { scrollYProgress } = useScroll();

useEffect(() => {
Expand Down Expand Up @@ -205,7 +201,6 @@ const Team = () => {
);
};

// Wrap Team component with ApolloProvider
const TeamWithApollo = () => (
<ApolloProvider client={client}>
<Team />
Expand Down

0 comments on commit 9d4a88f

Please sign in to comment.