apollographql / federation-hotchocolate

HotChocolate support for Apollo Federation
https://www.apollographql.com/docs/federation/
MIT License
16 stars 8 forks source link

Unable to use Apollo Federation with GraphQL service #73

Closed hitensam closed 7 months ago

hitensam commented 7 months ago

I did only the steps specified in the Installation but still getting Banana Cake Pop. Please Help!!

Screenshots:

image image

Project File:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="HotChocolate.AspNetCore" Version="13.6.0" />
      <PackageReference Include="ApolloGraphQL.HotChocolate.Federation" Version="1.3.0" />
  </ItemGroup>

</Project>
mabuyo commented 7 months ago

Hi there @hitensam! I'm not sure I understand the issue, are you expecting to see the Apollo Explorer IDE? Or something else?

hitensam commented 7 months ago

Hi @mabuyo !!!

Thanks for your response 😃.

I was expecting to see something like this:

image-4.png

mabuyo commented 7 months ago

Thanks for clarifying! So it is actually working as intended, since Hot Chocolate ships with their own IDE (Banana Cake Pop). However if you'd like to use the Apollo Explorer IDE, you can go to Studio Sandbox here: https://studio.apollographql.com/sandbox/explorer

Then update the endpoint to your local endpoint (wherever your GraphQL server is running). You'll also need to update the CORS settings in the Hot Chocolate server:

builder
  .Services
  .AddCors(options =>
  {
      options.AddDefaultPolicy(builder =>
      {
          builder
              .WithOrigins("https://studio.apollographql.com")
              .AllowAnyHeader()
              .AllowAnyMethod();
      });
  });

We have a lesson on this if you want more step by step instructions.

Hope this helps! I think there's also a way to update the default IDE, but I have to go searching for it... let me know if you're running into any issues with this approach.

hitensam commented 7 months ago

Thanks for your help 💯.

I will try the above said and will get back to you 😄.

hitensam commented 7 months ago

Firstly, what's this apollographql/federation-hotchocolate as I thought it would provide the IDE for the same.

Secondly, I updated CORS but couldn't use Studio Sandbox. I made the changes according to the Lesson.

🖼️ image

Thirdly, It would be great if we could replace Banana Cake Pop with Apollo Explorer IDE.

If it's not too much to ask, I'd be really grateful if you could provide me with a demo code, as I'm pretty new to GraphQL and we want to implement the same with .NET.

PS: I've already verified my email ID.

mabuyo commented 7 months ago

Firstly, what's this apollographql/federation-hotchocolate as I thought it would provide the IDE for the same.

To clarify, this repo is a library that works with Hot Chocolate to provide Federation v2 support.

Secondly, I updated CORS but couldn't use Studio Sandbox. I made the changes according to the Lesson.

Hmm, there might be something extra with CORS happening that's not allowing Sandbox to connect to your server. It's difficult to say without seeing the code to reproduce.

Thirdly, It would be great if we could replace Banana Cake Pop with Apollo Explorer IDE.

I would create a new issue and log this as a feature request!

If it's not too much to ask, I'd be really grateful if you could provide me with a demo code, as I'm pretty new to GraphQL and we want to implement the same with .NET.

Absolutely! We have two courses that walk through GraphQL & Federation with .NET:

And if you'd just like to explore the demo code, you can check out the final branches of each course's project code:

hitensam commented 7 months ago

🎉 Once again, a big thank you! I'll diligently follow each step provided in this guide and strive to implement the aforementioned.

👍 Just to confirm: Currently, the only way to utilize the Apollo Explorer IDE is through the Studio Sandbox, accessible here. Also, any method to override Banana Cake Pop is considered a feature request at this time.

❓ If there are any issues, is there a way for me to reach out to you?

mabuyo commented 7 months ago

👍 Just to confirm: Currently, the only way to utilize the Apollo Explorer IDE is through the Studio Sandbox, accessible here. Also, any method to override Banana Cake Pop is considered a feature request at this time.

Yes and yes :)

❓ If there are any issues, is there a way for me to reach out to you?

If you're taking any of the Odyssey courses I linked, there's a GitHub integration in each lesson, you can leave comments there if you're stuck! Otherwise, starting a thread in the Discord #general channel also works!

I'm going to close this issue now to keep the project issues clean but feel free to reach out through any of those channels!