Re: Registration Request for the respond-for HTTP preference

Michael Toomim <> Mon, 08 June 2020 07:27 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 62FBD3A0920 for <>; Mon, 8 Jun 2020 00:27:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -7.738
X-Spam-Status: No, score=-7.738 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, T_MIME_MALF=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id gWrzx2RAMOw3 for <>; Mon, 8 Jun 2020 00:27:44 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 854343A091E for <>; Mon, 8 Jun 2020 00:27:44 -0700 (PDT)
Received: from lists by with local (Exim 4.92) (envelope-from <>) id 1jiC9K-00055L-Px for; Mon, 08 Jun 2020 07:24:50 +0000
Resent-Date: Mon, 08 Jun 2020 07:24:50 +0000
Resent-Message-Id: <>
Received: from ([]) by with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <>) id 1jiC9I-00054a-Uf for; Mon, 08 Jun 2020 07:24:48 +0000
Received: from ([2607:f8b0:4864:20::530]) by with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <>) id 1jiC9H-00011V-9Z for; Mon, 08 Jun 2020 07:24:48 +0000
Received: by with SMTP id m1so8383060pgk.1 for <>; Mon, 08 Jun 2020 00:24:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=CKvBRfL/ZYygj2dNR18mqMEpCGMr8C1LDIGQ4ejaRjo=; b=VFDdLy02/ExIqta31BItyo1pKZQXjW3nHcdkYaZ2Z2R1yx04soqsdNvJIw8mWV/omk tdGzyB8gJ/9WIO0d/N+sIVApUVgE94JbWiK7QshKyLkFeKnUualp65Sw3JB1u+aF5LO0 k0Wf75ml98RjVvxfPuHE6YgmXmjUSY88L3xj/VRsUzIJsGxEwyFGg0COsmA2PSFpFIIg 6LYc+QWHulM1SoSxWdM9kPBmzgO5UETln8d2knBC0Y6x7TzlRpcOGjE6w5i2YEzrn9Qj OboiH0+meX+k6u1Eu+2dRjEhGvEWBapjLikORvZe7pG7LgP+5XtM+oWaPDPJ/jzqafsS uCoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=CKvBRfL/ZYygj2dNR18mqMEpCGMr8C1LDIGQ4ejaRjo=; b=SAoeAOGk3rTUyCG1qFD9AX1hSiLKmiw7uKaue/Qo33d6d55JPSPQ66gg3vpeeikyyE 5W9MufgeRQ4Z2Rv3lvmxOerbEtvNLN+EIPYBQsG6pG0Mo5lp5NADCt0w0N+mG6lXHCtz I/m494jLE9MD2iqZxLqV/PDmIniwNxEWl1O5YJB0CFNNX1/jli/kYYEFnI4gh7f6ratV jzph5xdoXT9Do08GIbzV3HEjYGSRtOqExqG8rjTmtNr0xjFtCWtj/x1ZSUS6coa7e+Rz Xp4QwW+EUV816KhSjxdcd+pYFua295kRpTzmU1Lo94V3bcMXv29A3QKhlzE/5tQJ+wr3 AwNw==
X-Gm-Message-State: AOAM532w13QsvLvCmvrAN2yaix0RaimHj+UuaXzRdUg3iTG040ZUeEV3 i8deoRT+ysqnK5yp5uXXe6M=
X-Google-Smtp-Source: ABdhPJzEfAwe2+PJDlw0FQaW5Dq4ZSSiDYdA5wRLNu86I4LWhNsqiCkXGZAK3I5uNxUglZd0v+GpPw==
X-Received: by 2002:a63:d54b:: with SMTP id v11mr18773748pgi.198.1591601075914; Mon, 08 Jun 2020 00:24:35 -0700 (PDT)
Received: from [] ( []) by with ESMTPSA id g21sm6128708pfh.134.2020. (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Mon, 08 Jun 2020 00:24:35 -0700 (PDT)
Content-Type: multipart/alternative; boundary="Apple-Mail=_0CF20663-5AA0-42F2-855C-D529ECA5D944"
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Michael Toomim <>
In-Reply-To: <>
Date: Mon, 8 Jun 2020 00:24:34 -0700
Message-Id: <>
References: <>
To: irakli <>
X-Mailer: Apple Mail (2.3124)
Received-SPF: pass client-ip=2607:f8b0:4864:20::530;;
X-W3C-Hub-Spam-Status: No, score=-4.1
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_MIME_MALF=0.01, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: 1jiC9H-00011V-9Z 07e5724485281b369b62a449132cf8ee
Subject: Re: Registration Request for the respond-for HTTP preference
Archived-At: <>
X-Mailing-List: <> archive/latest/37730
Precedence: list
List-Id: <>
List-Help: <>
List-Post: <>
List-Unsubscribe: <>

Irakli, thank you for this submission. I am quite interested in giving HTTP functionality from GraphQL.

In your approach, the server and client agree on a set of "bundles" of data to transmit, such as `minimal` or `full_representation`. This is cool! But I am curious why you want to specify which bundle to request using the `Prefer` header, rather than just in the URL?

For instance, what is the advantage of doing this:

  Get /users/123 HTTP/1.1
  Content-Type: application/json  
  Prefer: return=minimal
  Vary: Prefer,Accept,Accept-Encoding

Rather than this:

  Get /users/123?subset=minimal HTTP/1.1
  Content-Type: application/json  
  Vary: Prefer,Accept,Accept-Encoding

The reference blog post suggests that the problem with embedding the bundle-id in the URL is that it couples the client with the server. However, this is the case with specifying the bundle-id in the Prefer header as well.

> On Apr 27, 2020, at 7:06 PM, irakli <> wrote:
>    o  Preference: respond-for
>    o  Value: any alpha-numeric value. Dashes are also allowed.
>    o  Optional Parameters: None
>    o  Description: Expanded version of the "return" preference that 
> allows clients to hint to the server the use-case for the response.
> This allows batching response variations by common use-cases. The goal
> is similar to GraphQL: letting client choose which data it needs, but
> is significantly more light-weight and can allow all that client needs
> in a very wide variety of cases, without resorting to heavier and 
> potentially riskier GraphQL approach. For instance, for a blog post
> a client may request "respond-for: teaser" or "respond-for: full-post"  
>    o  Reference: <>
>    o  Notes: We have used this approach successfully at a number of 
> companies over the years but would like to standardize the preference
> rather than using an unregistered preference, or using the "return" 
> preference with values that are non-standard.
> Thank you!
> Irakli Nadareishvili