Basic schema import code
This commit is contained in:
parent
4dc2975d03
commit
654efe2b6f
7
schema/build.rs
Normal file
7
schema/build.rs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
fn main() {
|
||||||
|
cynic_codegen::register_schema("startgg")
|
||||||
|
.from_sdl_file("src/startgg.graphql")
|
||||||
|
.unwrap()
|
||||||
|
.as_default()
|
||||||
|
.unwrap();
|
||||||
|
}
|
|
@ -1,14 +1,3 @@
|
||||||
pub fn add(left: usize, right: usize) -> usize {
|
|
||||||
left + right
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cynic::schema("startgg")]
|
||||||
mod tests {
|
mod schema {}
|
||||||
use super::*;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn it_works() {
|
|
||||||
let result = add(2, 2);
|
|
||||||
assert_eq!(result, 4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
2566
schema/src/startgg.graphql
Normal file
2566
schema/src/startgg.graphql
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue