Skip to content

Add config for public introspection query on schema plugin#154

Merged
00dav00 merged 2 commits intomasterfrom
allow-interpreter-query-to-be-executed-without-auth
Mar 7, 2021
Merged

Add config for public introspection query on schema plugin#154
00dav00 merged 2 commits intomasterfrom
allow-interpreter-query-to-be-executed-without-auth

Conversation

@00dav00
Copy link
Copy Markdown
Contributor

@00dav00 00dav00 commented Feb 28, 2021

No description provided.

@00dav00 00dav00 changed the title Add config for public introspection query on schema plugin [skip ci] Add config for public introspection query on schema plugin Mar 3, 2021
Copy link
Copy Markdown
Member

@mcelicalderon mcelicalderon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just left 2 comments

Comment thread lib/graphql_devise/schema_plugin.rb Outdated
DEFAULT_NOT_AUTHENTICATED = ->(field) { raise GraphqlDevise::AuthenticationError, "#{field} field requires authentication" }

def initialize(query: nil, mutation: nil, authenticate_default: true, resource_loaders: [], unauthenticated_proc: DEFAULT_NOT_AUTHENTICATED)
def initialize(query: nil, mutation: nil, authenticate_default: true, public_introspection: true, resource_loaders: [], unauthenticated_proc: DEFAULT_NOT_AUTHENTICATED)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure true should be the default. Maybe !Rails.env.production?

)
end

after do
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? I think returning false will only have an effect on the context

@00dav00 00dav00 force-pushed the allow-interpreter-query-to-be-executed-without-auth branch from aefcd01 to 401b9e5 Compare March 6, 2021 15:27
Copy link
Copy Markdown
Member

@mcelicalderon mcelicalderon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@00dav00 00dav00 merged commit 1d101e6 into master Mar 7, 2021
@00dav00 00dav00 deleted the allow-interpreter-query-to-be-executed-without-auth branch March 7, 2021 16:47
@mcelicalderon mcelicalderon added the enhancement New feature or request label Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants