README.md in graphql-preview-0.0.6 vs README.md in graphql-preview-0.0.7

- old
+ new

@@ -46,26 +46,37 @@ # You can have more than one of these! updated_on Date.new(2017, 11, 3), url: "http://example.com" # The parts of your GraphQL schema you want toggled by this preview toggled_on [ - Library::Author, # an object - Library::ExtraInfo, # an interface, - Library::Author.fields["socialSecurityNumber"], # a field - Library::Book.fields["author"].arguments["includeMiddleInitial"], # an argument - Library::Likeable, # a union, - Library::Cover, # an enum - Library::Cover.values["DIGITAL"], # an enum value - Library::BookOrder, # an input object - Library::AddLike, # a mutation + "Author", # an object + "ExtraInfo", # an interface, + "Author.socialSecurityNumber", # a field + "Book.author.includeMiddleInitial", # an argument + "Likeable", # a union, + "Cover", # an enum + "Cover.DIGITAL", # an enum value + "BookOrder", # an input object + "Mutation.addLike", # a mutation ] end ``` ### Toggling the preview on your schema This gem introduces a new method to apply on your schema, `enabled_previews`. It takes an array, and you should pass in the list of preview classes you want enabled on your schema. For example: + +``` ruby +class Schema < GraphQL::Schema + query(query_type) + enabled_previews [ + TestPreview + ] +end +``` + +If you are using `graphql-ruby`'s `.define` DSL a similar API is provided: ``` ruby GraphQL::Schema.define do query(query_type) enabled_previews [