Skip to content
Snippets Groups Projects

Remove graphql-yoga

Closed Hannes Heine requested to merge pr1040head into pr1040base

Created by: Tirokk

roschaefer Authored by roschaefer Merged


:cake: Pullrequest

After we decided to seed our database directly in our tests and not going over HTTP, this PR will remove graphql-yoga (insufficiently maintained, 3rd party) for apollo-server. This will also free us from the obsolete extra server during backend testing, apollo-server-testing works without starting an entire HTTP server. We even might get reasonable code coverage now @ulfgebhardt :wink:

doge

Issues

  • None

Todo

  • None

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
20 20
21 21 const createServer = options => {
22 22 const defaults = {
23 context: async ({ request }) => {
24 const user = await decode(driver, request.headers.authorization)
23 context: async ({ req }) => {
  • Created by: Tirokk

    mattwr18 Authored by mattwr18


    Outdated (history rewrite) - original diff


    @@ -20,28 +20,30 @@ const driver = getDriver()
     
     const createServer = options => {
       const defaults = {
    -    context: async ({ request }) => {
    -      const user = await decode(driver, request.headers.authorization)
    +    context: async ({ req }) => {

    Can you explain this change? I see cases where I would like to go through the code base and do the opposite where I spell it out further, but I respect that others like to shorten variables, but if I lengthen and you shorten, we are kinda working against each other, or should we try to decide a standard and all stick by it?

  • Created by: Tirokk

    Tirokk Authored by Tirokk


    Same, same … :joy:

  • Created by: Tirokk

    roschaefer Authored by roschaefer


    Again, not my decision, but apollo's decision. I would spell it request and so does graphql-yoga, but apollo uses req.

  • Created by: Tirokk

    roschaefer Authored by roschaefer


    Read this for the why.

  • Created by: Tirokk

    Tirokk Authored by Tirokk


    Thanks for letting us understand. :thumbsup_tone2:

  • Hannes Heine
    Hannes Heine @Elweyn started a thread on commit d59c94c9
  • 15 15 authorization: `Bearer ${response.login}`,
    16 16 }
    17 17 }
    18
    19 //* This is a fake ES2015 template string, just to benefit of syntax
    20 // highlighting of `gql` template strings in certain editors.
    21 export function gql(strings) {
    22 return strings.join('')
    23 }
    • Created by: Tirokk

      mattwr18 Authored by mattwr18


      Outdated (history rewrite) - original diff


      @@ -15,3 +15,9 @@ export async function login(variables) {
           authorization: `Bearer ${response.login}`,
         }
       }
      +
      +//* This is a fake ES2015 template string, just to benefit of syntax
      +// highlighting of `gql` template strings in certain editors.
      +export function gql(strings) {
      +  return strings.join('')
      +}

      I like this solution, but how do you feel about it @roschaefer don't want you to feel like you are making too many concessions I am also ok dealing with no syntax highlighting, not sure how @Tirokk feels.

  • Created by: Mogge

    Review: Approved

  • Created by: Mogge

    Review: Changes requested

    I always implement the gql tag and we have just spoken about that I would love to have that for Cypher as well. So I really don’t understand, why you remove it … @roschaefer Please let it in place!

    Your work at all seems to be great here, @roschaefer ! :rocket::dizzy:

  • Created by: Mogge

    Review: Approved

    Cool you found that out @roschaefer ! :sunglasses: Works absolut fine with me. :grin:

    Nothing is written in stone

  • Please register or sign in to reply
    Loading