Notes on Apollo GraphQL OpenAI ChatGPT Connector, 24 April 2025 live stream video (event)

Quick-Info

Based on my viewing the video (event) and doing some browsing/reading up later, my summary view is as follows:
  1. Though advertised as "ChatGPT Connector—No Code Required", it is not exactly a 'no code' solution. It needs fair amount of declarative mapping code to transform ChatGPT REST API JSON response to JSON that frontend (React/Next.js etc.) needs.
  2. One has to learn how to use Apollo GraphQL Connector and related tools. One also has to learn ChatGPT REST API requests and responses.
  3. ChatGPT REST API does not seem to have free tier (unlike ChatGPT which has a free tier). So it seems that one has to pay money to use ChatGPT API even for sample programs. Note that even if Apollo GraphQL Connector is used, it invokes ChatGPT REST API and so has to pay money to ChatGPT API for that to work.
  4. If paid ChatGPT API usage is okay then going through Apollo GraphQL Connector may be easier than directly using ChatGPT REST API once one does the main declarative coding mapping of ChatGPT REST API response data to data that the frontend (React/Next.js etc.) app needs.

Details

Recently I received an email invite from Apollo GraphQL titled, "Final Invitation: Build an OpenAI ChatGPT Connector—No Code Required".  The event was on LinkedIn: https://www.linkedin.com/events/7318665182405083136/ .

The invitation stated, "You already know what OpenAI’s ChatGPT can do. But what if you could integrate it into your app—without writing a single line of backend code?" . In the past I did find some of Apollo GraphQL free library products to be very easy to use in React / Next.js web apps for queries (as against updates/mutations) against GraphQL API backends. I had to get some idea about how to compose a GraphQL query but that was not so problematic as there is a playground like tool where one can try out the GraphQL query composition without knowing GraphQL syntax. [The query is generated by the tool which can be copy-pasted into the Next.js/React app as part of the fetch request data. ... Example of such GraphQL API for Bhagavad Gita verses: https://github.com/gita/bhagavad-gita-graphql . They use "PostGraphile to instantly spin up a GraphQL API from (their) PostgreSQL database." ]

So I was quite interested in this event and wondered if Apollo GraphQL is making it very easy to connect a React or Next.js (or other front end tech) app to ChatGPT with minimal coding. I attended the event which was just a video live-stream without any audience interaction (I had thought it may be a bigger thing with some audience interaction).

After watching the video and doing some browsing/reading up, I think that the email part: "integrate it into your app—without writing a single line of backend code" was an oversell 😏. The video was helpful in showing some examples of how to map ChatGPT REST API to Apollo GraphQL Connector but that still needs the developer to do such mapping himself/herself by writing declarative mapping code. While technically one can say that one is not writing procedural code for doing such mapping, but there is a lot of declarative code that one has to write and try out.

The video's example declarative code will surely be helpful but that alone may not be enough to provide the required ChatGPT functionality in a React/Next.js app. Note that the declarative coding has to be done on the front-end (as per my understanding) and not back-end but that declarative coding has to be done! Also the video does not show the Apollo Connector being used in a React or Next.js app but uses it in some Apollo GraphQL development tool in VSCode. But I think it may be quite simple to invoke the Apollo Connector in a React or Next.js app.

A positive from watching the video and then browsing and reading up on the topic is that I now have an idea of how to approach adding ChatGPT functionality to a React/Next.js app. I also think that going through Apollo GraphQL Connector may be more easier than directly using ChatGPT REST API once one does the main declarative coding mapping ChatGPT REST API response data to data that the React/Next.js app needs.

Links:
The event video: Integrate OpenAI’s ChatGPT with no code using Connectors, https://www.youtube.com/watch?v=UYXmtX_0ooA , 37 min. 44 secs. by Apollo GraphQL streamed live on 24 April 2025.

Some links shown in or related to event video:
  1. OpenAI API: Introduction, https://platform.openai.com/docs/api-reference/introduction
  2. OpenAI API: Models, https://platform.openai.com/docs/api-reference/models
  3. OpenAI API: Chat Completions, https://platform.openai.com/docs/api-reference/chat
  4. Apollo GraphQL: Connectors Mapping Playground, https://www.apollographql.com/connectors-mapping-playground
    1. [Related link: (An introduction/tutorial to Connectors Mapping Playground:) Connectors: Mapping & transforms, https://www.apollographql.com/tutorials/connectors-mapping-and-transforms/01-intro-and-setup . A key quote from it: "With Connectors, we can connect to REST data sources and map the properties we want to the types and fields in our API—and all the work takes place in the GraphQL schema." JSON output of REST API is mapped & transformed to some other JSON that is wanted.]
  5. Apollo's VS Code Extension, https://marketplace.visualstudio.com/items?itemName=apollographql.vscode-apollo
  6. The Rover dev Command, https://www.apollographql.com/docs/rover/commands/dev
Some related links that I looked up while browsing/reading up after watching the video:
  1. Apollo Connectors for REST APIs, https://www.apollographql.com/docs/graphos/schema-design/connectors
  2. Schema Design with Apollo GraphOS, https://www.apollographql.com/docs/graphos/schema-design
  3. GraphQL meets REST, with Apollo Connectors, https://www.apollographql.com/tutorials/connectors-intro-rest
  4. What Is GraphQL? REST vs. GraphQL, https://www.youtube.com/watch?v=yWzKJPw_VzM , 5 min. 14 secs.
I also tried out a simple React program to use ChatGPT REST API (generated by Google Search AI). That did not work. It gave "POST https://api.openai.com/v1/chat/completions 429 (Too Many Requests)" error. Seems like only ChatGPT has a free tier. ChatGPT API does not have a free tier. As of now, I do not want to invest in buying tokens or whatever they are called from ChatGPT to use their REST API.

Some related React (or other) ChatGPT program links which I had a quick look at and which may be of interest for any future needs I may have to use (paid) ChatGPT API from a React frontend:

Notes

  1. API Access using free tier, https://community.openai.com/t/api-access-using-free-tier/710656 has responses from "_j" dated April 2024: "OpenAI is no longer giving any credits to pay for use simply for those that sign up." ... "The only thing you will be able to test without funding an API account with a minimum credit purchase (which is not a recurring subscription, but just pays for the API calls) is your ability to receive “429: check your billing” errors."
  2. https://platform.openai.com/settings/organization/billing/overview for my login, clearly shows: Credit remaining $0.00. So my free trial has 0 credit and so I keep getting 429 errors.
  3. Seems like in the past, ChatGPT API provided some credit amount in free trial. But that has been discontinued.
  4. As per https://help.openai.com/en/articles/9359041-openai-for-nonprofits , for the question "Do you offer nonprofit discounts on the API?", the answer is: "At this time, nonprofit discounts are only available for ChatGPT Team and ChatGPT Enterprise." So there does not seem to be any free tier for ChatGPT API even for nonprofit NGOs.

Comments