Fix issue with fuzzbuzz config
This commit is contained in:
parent
b666876064
commit
c03f7d6576
|
@ -242,18 +242,17 @@ query {
|
||||||
|
|
||||||
### Using variables
|
### Using variables
|
||||||
|
|
||||||
Variables and their values can be passed along side the GraphQL query. Using variables makes for better client side code as well as improved server side
|
Variables (`$product_id`) and their values (`"product_id": 5`) can be passed along side the GraphQL query. Using variables makes for better client side code as well as improved server side SQL query caching. The build-in web-ui also supports setting variables. Not having to manipulate your GraphQL query string to insert values into it makes for cleaner
|
||||||
caching. The build-in web ui also hass support for variables. Not having to manupilate your GraphQL query string to insert values into it makes for cleaner
|
|
||||||
and better client side code.
|
and better client side code.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// define the request object keeping the query and the variables seperate
|
// Define the request object keeping the query and the variables seperate
|
||||||
var req = {
|
var req = {
|
||||||
query: '{ product(id: $product_id) { name } }' ,
|
query: '{ product(id: $product_id) { name } }' ,
|
||||||
variables: { "product_id": 5 }
|
variables: { "product_id": 5 }
|
||||||
}
|
}
|
||||||
|
|
||||||
// use the fetch api to make the query
|
// Use the fetch api to make the query
|
||||||
fetch('http://localhost:8080/api/v1/graphql', {
|
fetch('http://localhost:8080/api/v1/graphql', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
|
|
@ -4,8 +4,8 @@ targets:
|
||||||
language: go
|
language: go
|
||||||
version: "1.12"
|
version: "1.12"
|
||||||
corpus: ./corpus
|
corpus: ./corpus
|
||||||
#memory_limit: 1000 # in megabytes
|
memory_limit: "100" # in megabytes
|
||||||
#timeout: 500 # in milliseconds
|
timeout: "500" # in milliseconds
|
||||||
harness:
|
harness:
|
||||||
function: FuzzerEntrypoint
|
function: FuzzerEntrypoint
|
||||||
# package defines where to import FuzzerEntrypoint from
|
# package defines where to import FuzzerEntrypoint from
|
||||||
|
|
|
@ -45,9 +45,15 @@ func compareOp(op1, op2 Operation) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestParse(t *testing.T) {
|
func TestCompile(t *testing.T) {
|
||||||
}
|
qcompile, _ := NewCompiler(Config{})
|
||||||
|
_, err := qcompile.CompileQuery(`query {
|
||||||
func BenchmarkParse(b *testing.B) {
|
product(id: 15) {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}`)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,7 +337,7 @@ func (com *Compiler) compileQuery(op *Operation) (*Query, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fil, ok := com.fm[selRoot.Table]
|
fil, ok := com.fm[selRoot.Table]
|
||||||
if !ok {
|
if !ok || fil == nil {
|
||||||
fil = com.fl
|
fil = com.fl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue