tailcall icon indicating copy to clipboard operation
tailcall copied to clipboard

feat: make tailcall "GraphQL over HTTP" compliant

Open tusharmath opened this issue 10 months ago â€ĸ 35 comments

Currently, tailcall doesn't support GraphQL over HTTP Spec

Technical Requirements

  • All existing tests should pass
  • Add new tests for every compliance violation
  • Ensure there is no performance degradation

Additional Information Use https://graphql-http.com to check for spec compliance.

Related Issues

  • For the /graphql route refer to https://github.com/tailcallhq/tailcall/issues/1790

Use the following configuration for testing.

schema
  @server(
    port: 8000
    graphiql: true
    hostname: "0.0.0.0"
    headers: {cors: {allowOrigins: ["*"], allowHeaders: ["*"], allowMethods: [POST, GET, OPTIONS]}}
  )
  @upstream(baseURL: "http://jsonplaceholder.typicode.com") {
  query: Query
}

type Query {
  posts: [Post] @http(path: "/posts")
}

type Post {
  id: Int!
  userId: Int!
  title: String!
  body: String!
}

tusharmath avatar Apr 22 '24 06:04 tusharmath

/bounty 200$

tusharmath avatar Apr 22 '24 06:04 tusharmath

💎 $200 bounty â€ĸ Tailcall Inc.

Steps to solve:

  1. Start working: Comment /attempt #1766 with your implementation plan
  2. Submit work: Create a pull request including /claim #1766 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

🙏 Thank you for contributing to tailcallhq/tailcall! 🧐 Checkout our guidelines before you get started. đŸ’ĩ More about our bounty program.

Attempt Started (GMT+0) Solution
🔴 @syedbarimanjan Apr 22, 2024, 6:50:15 AM WIP
🔴 @webbdays Apr 22, 2024, 1:48:23 PM WIP
🔴 @ologbonowiwi Apr 24, 2024, 3:58:41 PM WIP
đŸŸĸ @mogery May 19, 2024, 9:39:15 AM WIP
đŸŸĸ @ssddOnTop Jul 20, 2024, 9:07:26 AM #2480

algora-pbc[bot] avatar Apr 22 '24 06:04 algora-pbc[bot]

Currently, tailcall doesn't support GraphQL over HTTP Spec

Did you mean to link this back to this issue? @tusharmath

syedbarimanjan avatar Apr 22 '24 06:04 syedbarimanjan

@syedbarimanjan Fixed it, thanks!

tusharmath avatar Apr 22 '24 07:04 tusharmath

/attempt

Algora profile Completed bounties Tech Active attempts Options
@webbdays 1 tailcallhq bounty
Python, Rust,
JavaScript & more
Cancel attempt

webbdays avatar Apr 22 '24 13:04 webbdays

I would like to follow this https://graphql.github.io/graphql-over-http/draft/ . And work on one by one compliance requirement.

webbdays avatar Apr 22 '24 13:04 webbdays

Hi @tusharmath,

But that specification is still in draft. Any other specification to follow?

webbdays avatar Apr 22 '24 13:04 webbdays

I'd love to work on this. Putting myself on the queue 🤚đŸŊ

ologbonowiwi avatar Apr 22 '24 22:04 ologbonowiwi

Hi @tusharmath,

But that specification is still in draft. Any other specification to follow?

It's going to be in the draft state for a while I think. Supporting it however will become a necessity very soon because most tooling will start depending on it.

I think the best way to start is to pick items based on the severity of the issues.

tusharmath avatar Apr 23 '24 03:04 tusharmath

@webbdays: Reminder that in 1 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] avatar Apr 23 '24 13:04 algora-pbc[bot]

@tusharmath, our playground is currently /graphql; should we change it to /graphiql so that /graphql is used as described in the spec?

ologbonowiwi avatar Apr 23 '24 17:04 ologbonowiwi

@tusharmath, our playground is currently /graphql; should we change it to /graphiql so that /graphql is used as described in the spec?

We can use https://tailcall.run/playground/ instead of the current self hosted one.

tusharmath avatar Apr 24 '24 09:04 tusharmath

The bounty is up for grabs! Everyone is welcome to /attempt #1766 🙌

algora-pbc[bot] avatar Apr 24 '24 13:04 algora-pbc[bot]

Ok, now no one else is on the queue I'll /attempt.

Algora profile Completed bounties Tech Active attempts Options
@ologbonowiwi    32 tailcallhq bounties
+ 19 bounties from 5 projects
Rust, TypeScript,
Shell & more
Cancel attempt

ologbonowiwi avatar Apr 24 '24 15:04 ologbonowiwi

i am in. Currently working on the Accept header spec requirement. You can work parallel on other spec requirements.

webbdays avatar Apr 24 '24 16:04 webbdays

@ologbonowiwi

webbdays avatar Apr 24 '24 16:04 webbdays

Oh, sorry, @webbdays; as for the comment from the Algora bot, I thought you had dropped your attempt.

I plan to start from GET/POST on the /graphql route.

ologbonowiwi avatar Apr 24 '24 16:04 ologbonowiwi

ok. POST is must GET is optional according to spec.

webbdays avatar Apr 24 '24 16:04 webbdays

in spec 5.2 and 5.2.1 contradicts, isn't it?

webbdays avatar Apr 24 '24 16:04 webbdays

@ologbonowiwi Let me know which section numbers, you are currently plan to work? so that i can skip.

webbdays avatar Apr 24 '24 16:04 webbdays

Yeah, sure. For now, my only focus is to change the routing, so at least we can check against the app on https://graphql-http.com/

ologbonowiwi avatar Apr 24 '24 16:04 ologbonowiwi

I think the best way to start is to pick items based on the severity of the issues @tusharmath Can you mention those here as a priority list.

webbdays avatar Apr 24 '24 20:04 webbdays

I think the best way to start is to pick items based on the severity of the issues @tusharmath Can you mention those here as a priority list.

Check out the report generated.

tusharmath avatar Apr 25 '24 07:04 tusharmath

@ologbonowiwi: Reminder that in 1 days the bounty will become up for grabs, so please submit a pull request before then 🙏

algora-pbc[bot] avatar Apr 25 '24 15:04 algora-pbc[bot]

The bounty is up for grabs! Everyone is welcome to /attempt #1766 🙌

algora-pbc[bot] avatar Apr 26 '24 15:04 algora-pbc[bot]

/attempt #1766

Algora profile Completed bounties Tech Active attempts Options
@mogery    6 tailcallhq bounties
+ 17 bounties from 6 projects
Rust, TypeScript,
HTML & more
Cancel attempt

mogery avatar May 19 '24 09:05 mogery

/attempt #1766

(there are some problems with async-graphql, will fix those first)

Algora profile Completed bounties Tech Active attempts Options
@ssddOnTop 59 tailcallhq bounties
Rust, Java,
C & more
īšŸ2389
Cancel attempt

ssddOnTop avatar Jul 20 '24 09:07 ssddOnTop

[!NOTE] The user @mogery is already attempting to complete issue #1766 and claim the bounty. We recommend checking in on @mogery's progress, and potentially collaborating, before starting a new solution.

algora-pbc[bot] avatar Jul 20 '24 09:07 algora-pbc[bot]

I made this pull request to async_graphql to dictate that the extensions property is optional according to GraphQL over HTTP spec file.

https://github.com/async-graphql/async-graphql/pull/1569

karatakis avatar Aug 02 '24 07:08 karatakis

@karatakis I am already working on this at https://github.com/tailcallhq/tailcall/pull/2480

and I think https://github.com/async-graphql/async-graphql/pull/1569 is duplicate of https://github.com/async-graphql/async-graphql/pull/1563

ssddOnTop avatar Aug 02 '24 08:08 ssddOnTop