Article on

Typescript

Featured Image
Published: Jun 10, 2024

Typescript

content

// Contact Details Mutation
export const getcontactDetails = async (obj) => {
  if (!graphqlAPI) {
    console.error("GraphQL API endpoint is not defined");
    return [];
  }

  try {
    const response = await fetch("/api/contact", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify(obj),
    });

    return await response.json();
  } catch (error) {
    console.error("Error submitting contact details:", error);
    return { error: "Error submitting contact details" };
  }
};

Anya

Anya

Full Stack Developer

Comment Your Thoughts

Comments

No comments yet.

Recent Posts

No Posts Available

Trending Topics

No Categories Available

Never miss a beat!
Subscribe for the latest articles, reviews and tech insights straight to your inbox.

© 2024 Nextron Blog — Managed by Anjali |@anjalisah89

Contact for more information.