Code Monkey home page Code Monkey logo

Comments (3)

benjie avatar benjie commented on June 16, 2024

The data from the first code block is generated by the lookahead system/etc. It can change in patch versions and is heavily influenced by user input in the query itself. You are not expected to deal with anything that contains an @ symbol; these implementation details are internal.

This question is not one you should be asking; could you share what you're trying to achieve so that I can perhaps guide you down a better path?

from operation-hooks.

balasan avatar balasan commented on June 16, 2024

Thanks @benjie
I'm working on a micro-payment system for graphql queries. I'm using the after hook to request a payment from the client based on the size of the response payload. The request is throttled until payment is received. I have all the logic working well except:

  • I need to be able to generate a hash of the payload that the client can later match against the payments they made (an alternative solution might be attaching the hash of the input to the payload)
  • I also need the payload to be in its final form when pricing the data to enable the client to later verify that they were charged the right amount

Would really appreciate your advice on how I can accomplish this.

from operation-hooks.

benjie avatar benjie commented on June 16, 2024

As discussed in chat, this needs to be done outside of GraphQL after GraphQL has resolved. One option is to use a server plugin for this, it should work for queries and mutations but we don’t have hooks for post-processing subscription bodies currently.

from operation-hooks.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.