Giter Club home page Giter Club logo

graphql-rails_logger's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

graphql-rails_logger's Issues

Support with Lograge Gem

Unable to print the logs in GraphQL::RailsLogger way when lograge gem is included. We may need to add the functionality to support the lograge logs as well.

Parsing error with `Rails.application.config.filter_parameters`

ActiveSupport::Notifications is throwing an exception, related to how this gem parses certain filtered objects.

To replicate, add the variables param to your list of filtered params config like so.

# config/initializers/filter_parameter_logging.rb

Rails.application.config.filter_parameters += [
  :variables
]

Then making a GraphQL query will result in

Started POST "/v1/graphql" for 127.0.0.1 at 2022-03-02 12:34:55 -0600
Processing by API::GraphQLController#create as JSON
Could not log "start_processing.action_controller" event. JSON::ParserError: 451: unexpected token at 'FILTERED]' ...

This is what the output looks like without the graphql-rails_logger turned on:

Started POST "/v1/graphql" for 127.0.0.1 at 2022-03-02 12:38:57 -0600
Processing by API::GraphQLController#create as JSON

Parameters:
{"query"=>"{\n  profile {\n    id\n  }\n}", "variables"=>"[FILTERED]", "graphql"=>{"query"=>"{\n  profile {\n    id\n  }\n}", "variables"=>"[FILTERED]"}}

NoMethodError/nil-ref when using persisted queries

We recently switched to using persisted queries using this Rails gem.

We now get a nil-ref error on this line:
https://github.com/jetruby/graphql-rails_logger/blob/master/lib/graphql/rails_logger/subscriber.rb#L42

Could not log "start_processing.action_controller" event. NoMethodError: undefined method 'lines' for nil:NilClass

This is most likely caused by the fact the persisted query doesn't send along a query param, just a hash that the backend maps to the query. I think adding a check to this method to make sure data['query'].present? before trying to format should fix it.

Here's an example request:
https://localhost:3000/api/graphql?operationName=appBootstrap&variables={"userId":"abcd1234"}&extensions={"persistedQuery":{"version":1,"sha256Hash":"832db74c644f9a1e8123be4a6f7e19ade39fc9c590c4a75c7a7ffb2f2ab55948"}}

Thanks in advance!

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.