Skip to content
loading...

re: Free workshop on .NET Core + GraphQL + Serverless VIEW POST

FULL DISCUSSION
 

Thanks for the efforts 😄, Is GraphSQL is similar to OData ? Does it generates SQL statements on the fly. Will GraphSQL replace Odata ?

 

no, it doesn't become SQL, it's its own thing entirely.. In a sense, it's like SQL but on API level instead of close the database. Graphql will be more widely used I think.

 

Hi Shaijut & Chris
So GraphQL is not directly converted to SQL. But we do have a couple feature in hotchocolate.io that enable you to do so

Given this Query type we generate all the nested types you need. By annotating with attributes you can add additional behaviour on top of it.

public class Query {
     [UsePaging]
     [UseSelection]
     [UseSorting]
     [UseFiltering]
     public IQueryable<Jedi> GetJedis([Service]DBContext ctx) 
       => ctx.Jedis.AsQueryable()

}

When you now execute this query

{
  jedis(where: {name: "Han"}, order_by:{side:DESC}) { name side }
}

This SQL statement is executed:

SELECT [p].[Name],[p].[Side]
FROM [Jedis] AS [p]
WHERE [p].[Name] ="Han"
ORDER BY [p].[Side] DESC

Hi 😄 , What is difference b/w GraphQL for .NET and hotchocolate.io ? Why I should I use hotchocolate.io ? Anything special ?

Very good question :)
I think HotChocolate provides you with more features and more innovation. Code looks cleaner and it is overall much more fun to work with.
This question as asked in a issue once. You can read more about it here:
github.com/ChilliCream/hotchocolat...

This is a really good blog post about HotChocolate.
It only shows a fraction of it tough :D
dev.to/michaelstaib/get-started-wi...

Check out this example project If you want to get a feeling for it

Also, just join the community and try it out :)
You can find us on if you have any question along the way SLACK

code of conduct - report abuse