jetruby / graphql-rails_logger Goto Github PK
View Code? Open in Web Editor NEWDisplay GraphQL queries in a more readable format
License: MIT License
Display GraphQL queries in a more readable format
License: MIT License
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.
Hi,
I'm using Concourse CI that has a bug in its webUI that causes text blinking when using some ANSI colors. Is it possible to completely turn off ANSI highlighting somehow?
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]"}}
Move to GraphQL::RailsLogger.configure
block
Just adding your gem to a new GraphQL-ruby project and I face a problem
Could not log "start_processing.action_controller" event. NameError: uninitialized constant GraphQL::RailsLogger::Subscriber::PP
Can you help me to check and resolve that problem?
Thank you!
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!
First of all, great little helper tool for development. It would be great to be able to suppress the introspection queries so they don't clutter the console.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.